I have a dataframe df1 with 3 columns (A,B,C), NaN represents missing value here
A B C
1 2 NaN
2 1 2.3
2 3 2.5
I have a dataframe df2 with 3 columns (A,B,D)
A B D
1 2 2
2 1 2
2 3 4
The expected output would be
A B C
1 2 2
2 1 2.3
2 3 2.5
I want to have values in column C in df1 intact if not missing, replaced by corresponding value in D with other two columns value equal, i.e, df1.A==df2.A and df1.B==df2.B
any good solution?
df2and expected output likedf1