May-07-2018, 12:46 PM
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']
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']