Access multiple items with not equal to, !=

后端 未结 2 517
小蘑菇
小蘑菇 2021-01-30 12:04

I have the following Pandas DataFrame object df. It is a train schedule listing the date of departure, scheduled time of departure, and train company.



        
2条回答
  •  不思量自难忘°
    2021-01-30 12:17

    I like using the query method as it's a bit more clear

    df = df.query("Train not in ['DeutscheBahn', 'British Rails', 'SNCF']")
    

提交回复
热议问题