You can use merge
function, then rename and drop extra columns.
I added some extra actions with index to restore it after merging.
df1 = pd.DataFrame({
"code": ["FR", "US", "IT"],
"countries": ["France", "United-States", "Italy"]
})
df2 = pd.DataFrame({
"countries": ['FR', 'FR', 'IT', 'US', 'US', 'US', 'IT'],
"idx": range(7),
})
df2.reset_index(inplace=True)
df2 \
.merge(df1, left_on="countries", right_on="code") \
.rename({"countries_y": "countries"}, axis=1) \
.set_index("index") \
.drop(["code", "countries_x"], axis=1)
Output:
countries
index
0 France
1 France
2 Italy
6 Italy
3 United-States
4 United-States
5 United-States