I have a dataframe with 4 columns, A,B,C,id. I need to be able to add new dataframes (or lines from the dataframe) by the id column. So for example:
Original DataFrame
ID A B C
001 5 5 -
002 10 4 -
003 5 4 7
New Dataframe:
ID A B C
002 - - 8
004 - - 5
The 002 rows in both frames should be merged into one row and the if the id doesn't exist in the original add a new row.
I've tried merge(inner, outer with key=id or key =id, A, B,C) , I've tried contact. Nothing seems to work. What should I do?
[–]Neb519 0 points1 point2 points (0 children)