- #1
msn009
- 53
- 6
I have code snippet as below and when i run it, the dataframe seems to append after every loop and does not add the previous row into the frame, so at each time only one row is populated into the new dataframe. How do I ensure that the append function adds the previous row as well?
Python:
df2=pd.DataFrame()
for i,row in df.iterrows():
c =check_function(row)
if check_function != 'No':
calc_function= calc_function_1(row, c)
df3 = df2.append(calc_function_1)
print df3