diff_df = pd.merge(df1, df2, how='outer', indicator='Exist') diff_df = diff_df.loc[diff_df['Exist'] != 'both']