Filter Pandas DataFrame by time index

后端 未结 1 1864
北恋
北恋 2021-02-01 00:17

I have a pandas DataFrame from 6:36 AM to 5:31 PM. I want to remove all observations where the time is less than 8:00:00 AM. Here is my attempt:

df = df[df.ind         


        
1条回答
  •  别那么骄傲
    2021-02-01 01:18

    You want df.loc[df.index < '2013-10-16 08:00:00'] since you're selecting by label (index) and not by value.

    selecting by label

    0 讨论(0)
提交回复
热议问题