I have two dataFrames, one with iso codes and country names and the other one with only country names.
I would like to add a new column to df2 with the country names from df1 if the values df1.iso == df2.id match.
df1
Country iso
Afghanistan AFG
Afghanistan AFG
Afghanistan AFG
...
and df2
id
AFG
AFG
AFG
AFG
...
I tried this:
post['country'] = pre['Country'].where(pre['iso'] == post['id'])
But I got an error
ValueError: Can only compare identically-labeled Series objects