Deleting DataFrame row in Pandas based on column value

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

I have the following DataFrame:

             daysago  line_race rating        rw    wrating
 line_date                                                 
 2007         


        
10条回答
  •  悲哀的现实
    2020-11-22 04:46

    I compiled and run my code. This is accurate code. You can try it your own.

    data = pd.read_excel('file.xlsx')
    

    If you have any special character or space in column name you can write it in '' like in the given code:

    data = data[data['expire/t'].notnull()]
    print (date)
    

    If there is just a single string column name without any space or special character you can directly access it.

    data = data[data.expire ! = 0]
    print (date)
    

提交回复
热议问题