I need to combine two dataframes where they have similar columns however the 1st dataframe is missing one column i need to add values from 2nd dataframe to 1st
display(df)
id | TITLE | CODE | PRICE |
---|---|---|---|
1 | John | 12 | 125 |
2 | Katie | 14 | 325 |
4 | Janie | 24 | 550 |
5 | Jacob | 32 | 500 |
6 | John | 42 | 400 |
display(df2)
id | TITLE | CODE |
---|---|---|
7 | John | 12 |
8 | Katie | 14 |
9 | John | 42 |
10 | Janie | 50 |
11 | Elle | 32 |
12 | John | 42 |
Required Output:
id | TITLE | CODE | PRICE |
---|---|---|---|
7 | John | 12 | 125 |
8 | Katie | 14 | 325 |
9 | John | 42 | 400 |
10 | Janie | 50 | Nan |
11 | Elle | 32 | Nan |
12 | John | 42 | 400 |