def outer_parts(df1, df2):
    df3 = df1.merge(df2, indicator=True, how='outer')
return {n: g.drop('_merge', 1) for n, g in df3.groupby('_merge')}
dfs = outer_parts(df, df2)
Comparing two DataFrames by one column with a return of three different outputs with Panadas