Aug-14-2021, 12:38 PM
Assuming that the email values in one are present in the other
import pandas as pd d = {'email': ['[email protected]', '[email protected]', '[email protected]'], 'acronym': ['radar', 'laser', 'cia']} df1 = pd.DataFrame(data=d) d2 = {'email': ['[email protected]', '[email protected]', '[email protected]'], 'acronym': ['radar', 'fbi','jupyter']} df2 = pd.DataFrame(data=d2) df1['acronym'] = df2[df2['email'] == df1['email']]['acronym'] df1
Output: email acronym
0 [email protected] radar
1 [email protected] fbi
2 [email protected] jupyter