I have 2 dataframes having values as:
df1:
df2:
I want to do left join df1 with df2, on basis of office & year. But the office column seems to be need something like df2.Geography contains df1.office.
How to do that ? Also df2 have duplicates values for office. The first row having matched would be good enough.
Thanks for your help.
Edit1:
Here's my code. But it's - I'm using year because I dont know how to join on office.
completedata_external = pd.merge(df1,df2,left_on=['year'], right_on=['Year'],how="left")