I am trying to concatenate two dataframes that share a column. One dataframe has all the columns, but the second one is just the single changed column. I want to concatenate them so that the old values are overwritten by the new values. I’ve tried every way I can think of to do this, but I’m not making any progress. Here’s what I want to happen:
A B
0 1 2
1 2 3
concatenate with:
A
0 3
1 4
to be:
A B
0 3 2
1 4 3
pd.concat(frames, axis=1) has gotten me the closest. Two rows are messed up but they should be combined. The incorrect rows show like this:
A B
0 1 NaN
1 NaN 1
The rows should be combined together to get the correct output.