Let's say I have the following dataframe X (ppid is unique):
ppid col2 ...
1 'id1' '1'
2 'id2' '2'
3 'id3' '3'
...
I have another dataframe which serves as a mapping. ppid is same as above and unique, however it might not contain all X's ppids:
ppid val
1 'id1' '5'
2 'id2' '6'
I would like to use the mapping dataframe to switch col2 in dataframe X according to where the ppids are equal (in reality, they're multiple columns which are unique together), to get:
ppid col2 ...
1 'id1' '5'
2 'id2' '6'
3 'id3' '3' # didn't change, as there's no match
...