Search for “does-not-contain” on a DataFrame in pandas

后端 未结 6 2076
谎友^
谎友^ 2020-11-28 02:31

I\'ve done some searching and can\'t figure out how to filter a dataframe by df[\"col\"].str.contains(word), however I\'m wondering if there is a way to do the

6条回答
  •  半阙折子戏
    2020-11-28 02:55

    Additional to nanselm2's answer, you can use 0 instead of False:

    df["col"].str.contains(word)==0
    

提交回复
热议问题