I have two dataframes. One looks like this:
df1:
col1 col2 col3 newcol
0 1 2000 10 NaN
1 3 4000 20 NaN
2 5 8000 30 NaN
...
100 7 2000 23 NaN
Each combination of values in a row is unique.
And a second df.
df2:
col1 col2 col3 value
...
5 1 2000 10 7
7 3 6600 52 6
...
500 1 1000 78 2
Now i want to compare the two dataframes and put every entry of the df2 column "value" where col1, col2 and col3 matches the entries of df1 into df1 column "newcol".
I tried using ".map" but i couldnt get multiple conditions to work. Is map a good function to use in this scenario?
Expected Output:
df1:
col1 col2 col3 newcol
0 1 2000 10 7
1 3 4000 20 NaN
2 5 8000 30 NaN
...
100 7 2000 23 NaN