pandas get rows which are NOT in other dataframe

后端 未结 13 841
春和景丽
春和景丽 2020-11-22 02:17

I\'ve two pandas data frames which have some rows in common.

Suppose dataframe2 is a subset of dataframe1.

How can I get the rows of dataframe1 which

相关标签:
13条回答
  • 2020-11-22 03:06

    You can also concat df1, df2:

    x = pd.concat([df1, df2])
    

    and then remove all duplicates:

    y = x.drop_duplicates(keep=False, inplace=False)
    
    0 讨论(0)
提交回复
热议问题