Remove one dataframe from another with Pandas

前端 未结 5 908
挽巷
挽巷 2021-01-19 23:55

I have two dataframes of different size (df1 nad df2). I would like to remove from df1 all the rows which are stored within df2<

5条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-20 00:43

    The cleanest way I found was to use drop from pandas using the index of the dataframe you want to drop:

    df1.drop(df2.index, axis=0,inplace=True)
    

提交回复
热议问题