I have 2 dataFrames.
df1:
index ID City Region 2City
1 23 Moscow Msk
2 34 Obninsk Msk Msk
3 56 Spb
4 17 Tula Spb
df2:
index City Office
1 Msk Msk
2 Spb Spb
3 Tula Msk
4 Moscow Msk
I would like to get the following df:
index ID City Region 2City Office
1 23 Moscow Msk Msk
2 34 Obninsk Msk Msk Msk
3 56 Spb Spb
4 17 Tula Spb Msk
So it checks which 'office' from df2 matches 'City', 'Region', '2City' from df1.
Also if I found 'office' for 'City', I stop to search. So 'City'column have the priority, then comes 'Region', then comes '2City'.
I know how to do this with 3 for, but I hope there is a better option.