Deleting DataFrame row in Pandas based on column value

前端 未结 10 2220
悲哀的现实
悲哀的现实 2020-11-22 04:08

I have the following DataFrame:

             daysago  line_race rating        rw    wrating
 line_date                                                 
 2007         


        
10条回答
  •  伪装坚强ぢ
    2020-11-22 04:48

    just to add another solution, particularly useful if you are using the new pandas assessors, other solutions will replace the original pandas and lose the assessors

    df.drop(df.loc[df['line_race']==0].index, inplace=True)
    

提交回复
热议问题