Currently met with a problem when handling a comparison betweem two data frames. df1 contains rows I would like to drop with a value is found in df2
df1 = col1: (cat, dog, mouse, rabbit, shrew, shark, deer, human)
df2 = col3: (mouse, rabbit)
From the above example data frames i would like to remove rows featuring 'mouse' and 'rabbit' from df1.
I have tried:
df1.loc[df1['col1'] != df2['col3']]
However this requires both series to be the same length and only compares rows in df1 to the row in df2 with the same index (not hashable)
Any help would be appreciated.
I am mainly working with pandas & numpy