Suppose I have df1:
col1 col2
Day0 'A' NaN
Day1 'B' 'C'
Day2 'C' 'A'
and df2:
'A' 'B' 'C'
Day0 1 4 3
Day1 2 7 6
Day2 5 1 10
How can I replace values in df1 using values from df2 to get output like this:
col1 col2
Day0 1 Nan
Day1 7 6
Day2 10 5
What I have in my mind is that I cbind these two dataframes and try to replace the values on each column based on the specified column but did not seem to have a short way to do.