0

I have two separate pandas dataframes (df1 and df2) and I want to remove records from df1 if the combination also exists in df2

df1

A     B     C     D
66    9     hi    pickle
66    5     hello ham
20    4     hi    cheese

df2

A     B     C     D
66    9     could be anything

Result df (remove row containing unique combination of 66 and 9 df1)

A     B     C     D
66    5     hello ham
20    4     hi    cheese

I though of using the isin method, but dont know how to use it with two columns. Is this possible without looping?

0 Answers0