0

Suppose you have these two dfs:

df1=
col1  col2  col3
 3     45    abc
 2     21    eed
 6     90    cdf
 7     87    gzp
df2=
firstcol   secondcol   thirdcol
   3          45        33456
   7          87        89421
   6          90        19243
   2          21        24435

and I want to add 'thirdcol' to df1, when certain columns/ a selected list of columns match (so first two columns here). In df2 the second and fourth row switched places for examples. My wanted result df would be this:

result= 
col1  col2  col3  thirdcol
 3     45    abc   33456
 2     21    eed   24435
 6     90    cdf   19243
 7     87    gzp   89421

Can anyone help please?

John
  • 91
  • 7

0 Answers0