I have two pandas dataframes. Lets say the first one is master
ID COL1 COL2
1 A AA
2 B BB
3 C CC
4 D DD
And another one source
ID COL1 COL2
1 A ZZ
2 B BB
3 YY CC
5 G GG
6 H HH
Evidently the length can be different and the difference can be in more than one column. However, the structure will be the same. I want to find the records in the source
that are either new or different from what is available in master
. That is, the output I am looking for is a dataframe:
ID COL1 COL2
1 A ZZ
3 YY CC
5 G GG
6 H HH
I tried solutions in:
- Outputting difference in two Pandas dataframes side by side - highlighting the difference
- Comparing two dataframes and getting the differences
But none of those seems to be working for me. This is basically trying to find out what's new.