I would like to map the values in df1 dataframe to the df2 dataframe.
df:
id | name |
---|---|
1001 | john |
1002 | amy |
1003 | jim |
df2:
name | salary | department |
---|---|---|
john | 2000 | A |
amy | 3000 | B |
jim | 4000 | C |
john | 5000 | D |
jim | 6000 | E |
amy | 7000 | F |
Output should be like this ,df3:
name | id | salary | department |
---|---|---|---|
john | 1001 | 2000 | A |
amy | 1002 | 3000 | B |
jim | 1003 | 4000 | C |
john | 1001 | 5000 | D |
jim | 1003 | 6000 | E |
amy | 1002 | 7000 | F |