I have 2 dfs of different sizes. If the value df A matches df B, get the value from another column from df B to A.
Original df:
original_df = pd.DataFrame({'Patients': ['Kevin', 'John', 'Marry', 'Joe'],
'Region': ['New York', 'Austin', 'Dallas', 'Dallas']})
Patients Region
0 Kevin New York
1 John Austin
2 Marry Dallas
3 Joe Dallas
Region df:
region_df = pd.DataFrame({'Region': ['New York', 'Portland', 'Dallas', 'Austin', 'Vermont'],
'Lat': [10, 14, 13, 16, 15],
'Long': [19.1, 12.1, 16.2, 21.5, 29.3]})
Region Lat Long
0 New York 10 19.1
1 Portland 14 12.1
2 Dallas 13 16.2
3 Austin 16 21.5
4 Vermont 15 29.3
Expected result df:
Patients Region Lat Long
0 Kevin New York 10 19.1
1 John Austin 16 21.5
2 Marry Dallas 13 16.2
3 Joe Dallas 13 16.2
Thank you so much