My df1 is something like first table in the below image with the key column being Name. I want to add new rows from another dataframe, df2, which has only Name, Year, and Value columns. The new rows should get added based on Name. Other columns would just repeat the same value per Name. Results should be similar to the second table in the below image. How can I do this in pandas ?
Asked
Active
Viewed 43 times
0
-
1Please provide a [mcve] people can work with instead of text only. – emilaz Apr 17 '20 at 09:02
1 Answers
0
Create a sub table df3 of df1 consist of Group, Name, and Other and only keep distinct records. And left join df2 and df3 to get desired result.

Xiao Huang
- 51
- 3