Reputation: 1297
Suprisingly, i can't find an analogue of SQL's "NOT IN" operator in pandas DataFrames.
A = pd.DataFrame({'a':[6,8,3,9,5],
'b':['II','I','I','III','II']})
B = pd.DataFrame({'c':[1,2,3,4,5]})
I want all rows from A
, which a
doesn't contain values from B
's c
.
Something like:
A = A[ A.a not in B.c]
Upvotes: 8
Views: 8577