1import pandas as pd
2
3df1 = pd.read_csv('old.csv')
4df2 = pd.read_csv('new.csv')
5
6df1['flag'] = 'old'
7df2['flag'] = 'new'
8
9df = pd.concat([df1, df2])
10
11dups_dropped = df.drop_duplicates(df.columns.difference(['flag']), keep=False)
12dups_dropped.to_csv('update.csv', index=False)
13