I have one main df
that has one column I would like to update with values from a second df1
.
The tricky part for me is that I need a match on 2 common columns from each df to know which value to update.
Using an example:
df col1 col2 col3
1 1A Z4 4
2 1B Z5 2
3 1C Z6 7
4 1D Z7 1
5 1E Z12 9
df1 col1 col2 col3
1 1G Z9 1
2 1B Z5 2
3 1C Z6 3
4 1D Z7 4
5 1E Z8 5
Output:
df col1 col2 col3
1 1A Z4 4 (no match, no update)
2 1B Z5 2 (match, updated)
3 1C Z6 3 (match, updated)
4 1D Z7 4 (match, updated)
5 1E Z12 9 (not matched on both, no update)
Thank you for your assistance.