0

I have two dataframes (df1, df2) both containing column 'A'. Lenght of df1['A'] is 678, while lenght of df2['A'] is 618. I want to compare those two columns from both dataframes and print out values (60), that only appeared in df1 and not df2, so i can detect which values differ in dataframe's columns.

df1                   df2

 A B C D E...         A B C D E...
 1                    3
 2                    4
 3                    5
 4
 5

Result woud be: (1,2)

So far i tried:

set(df1['A']).intersection(set(df2['A']))

Which returns me duplicates.

df1[~df1.apply(tuple,1).isin(df2.apply(tuple,1))]

Which returns me total a total mess of 678 row with messed order cells.

KayEss
  • 419
  • 4
  • 18

0 Answers0