Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
upend data to dataframe
#1
Hi,

I am new in python. Here i'm trying to run loop with data frame and doing sum and also trying to insert data to another dataframe but unable to insert data to another dataframe.

num=0
max_value=200000
for index, row in df1.iterrows():
if num > max_value:
break # break here
print(row['LOAN_AGREEMENT_NO'],row['CITY'],row['POS_AS_ON_DATE'])## i want to insert these three column in another dataframe.
## print( row)
num = num + row['POS_AS_ON_DATE']
Reply
#2
Hi, welcome to Python and the forums!
Please put your code in Python code tags, you can find help here.
Also be more specific about the problem. If you get errors, put full error traceback message in error tags. If result is not as expected, show actual vs. desired result (you can use output tags).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Filter data into new dataframe as main dataframe is being populated cubangt 8 1,036 Oct-23-2023, 12:43 AM
Last Post: cubangt
  Seeing al the data in a dataframe or numpy.array Led_Zeppelin 1 1,170 Jul-11-2022, 08:54 PM
Last Post: Larz60+
  Need help formatting dataframe data before saving to CSV cubangt 16 6,021 Jul-01-2022, 12:54 PM
Last Post: cubangt
  Reading data to python: turn into list or dataframe hhchenfx 2 5,423 Jun-01-2021, 10:28 AM
Last Post: Larz60+
  How to save json data in a dataframe shantanu97 1 2,177 Apr-15-2021, 02:44 PM
Last Post: klllmmm
  Pandas Extract data from two dataframe nio74maz 1 2,200 Dec-26-2020, 09:52 PM
Last Post: nio74maz
  Issue while inserting data into Teradata via python dataframe sandy 2 4,249 Feb-10-2019, 08:06 PM
Last Post: sandy
  how to load large data into dataframe. sandy 0 2,666 Feb-01-2019, 06:19 PM
Last Post: sandy
  Dataframe Data Query Database ab0217 0 2,301 Oct-16-2018, 02:26 AM
Last Post: ab0217

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020