Here is the code:
input:
df1 = pd.DataFrame({'a': [1,2,3], 'b': [2,3,4], 'c':['aa','bb','cc'], 'd':[5,9,1]})
df2 = pd.DataFrame({'a': [4,5,6], 'b': [7,8,9], 'c':['dd','ee','ff'], 'd':[50,90,10]})
combinedframes_add = df1.add(df2, fill_value=0)
output:
a b c d
0 5 9 aadd 55
1 7 11 bbee 99
2 9 13 ccff 11
But I want my output to like this:
a b c d
0 1 9 aadd 55
1 2 11 bbee 99
2 3 13 ccff 11
'a' column should not be added, it should remain the same as in df1.
How can I achieve that?
Thanks in advance.