Deleting DataFrame row in Pandas based on column value

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

I have the following DataFrame:

             daysago  line_race rating        rw    wrating
 line_date                                                 
 2007         


        
10条回答
  •  旧巷少年郎
    2020-11-22 04:40

    Though the previou answer are almost similar to what I am going to do, but using the index method does not require using another indexing method .loc(). It can be done in a similar but precise manner as

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

提交回复
热议问题