0

I have two data frames

enter image description here

Now df1 has 10000 rows and df2 has 200 rows where I have to match each row of df1 to df2 based on col1 and col2 and if it matches take col3 of df2 and add it to df1.

I tried df.iterrows but is very slow and giving improper values. Tried df.merge and np.select as well but not helpful. Is there a best approach to solve this? Please suggest.

NB: If I have to add additional conditions is that possible?

Mark Rotteveel
  • 90,369
  • 161
  • 124
  • 175
narayanan s
  • 101
  • 1
  • 9

0 Answers0