How to select rows that do not start with some str in pandas?

前端 未结 5 1015
别跟我提以往
别跟我提以往 2020-12-29 04:34

I want to select rows that the values do not start with some str. For example, I have a pandas df, and I want to select data do not start with t, a

5条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-29 05:17

    Just another alternative in case you prefer regex:

    df1[df1.col.str.contains('^[^tc]')]
    

提交回复
热议问题