1

I have a master sheet that contains information that I have to use. Every month, I would have a new sheet that will contain rows that are present in the master sheet and also some new unique rows. I want to extract the new and unique rows of the new sheet as I have to make some edits to it before adding them on to the master sheet. How can I do so? Below is an example of the sheets:

Master sheet:

ID Name Location
1 AA 1234
2 BB 2345
3 CC 3456
4 DD 4567
5 EE 5678
... ... ...

New Sheet:

ID Name Location
2 BB 2345
4 DD 4567
5 EE 5678
6 FF 6789
7 GG 7890

Desired output:

ID Name Location
6 FF 6789
7 GG 7890
U13-Forward
  • 69,221
  • 14
  • 89
  • 114
Ian
  • 21
  • 3

1 Answers1

2

Try this:

print(new_sheet.loc[~new_sheet['ID'].isin(master_sheet['ID']))
U13-Forward
  • 69,221
  • 14
  • 89
  • 114