I have two separate pandas dataframes (df1
and df2
) which have multiple columns, but only one in common ('text').
I would like to do find every row in df2
that does not have a match in any of the rows of the column that df2
and df1
have in common.
df1
A B text
45 2 score
33 5 miss
20 1 score
df2
C D text
.5 2 shot
.3 2 shot
.3 1 miss
Result df (remove row containing miss since it occurs in df1)
C D text
.5 2 shot
.3 2 shot
Is it possible to use the isin
method in this scenario?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…