📅  最后修改于: 2022-03-11 14:45:49.442000             🧑  作者: Mango
import pandas as pd
df1 = pd.read_csv('old.csv')
df2 = pd.read_csv('new.csv')
df1['flag'] = 'old'
df2['flag'] = 'new'
df = pd.concat([df1, df2])
dups_dropped = df.drop_duplicates(df.columns.difference(['flag']), keep=False)
dups_dropped.to_csv('update.csv', index=False)