I have 2 dataframes, c_r and x. I am trying to append an empty dataframe, with this code:
new_df = pd.DataFrame()
for i in c_r:
for j in x:
if c_r[i].dtype != object and x[j].dtype != object:
if i == j:
col_c = c_r[i]
col_j = x[j]
new_df[i+'-Diff'] = col_c - col_j
else:
break
But I keep getting back an empty data frame. Can anyone suggest what I am doing wrong? Thanks
c_r?c_randxas two column df), I get new_df as the difference between them. Do this: Share a few rows of the two df and how you want the output to look like.