I have a Pandas DataFrame with a DatetimeIndex and one column MSE Loss
the index is formatted as follows:
DatetimeIndex(['2015-07-16 07:14:41', '2015-07-16 07:14:48',
'2015-07-16 07:14:54', '2015-07-16 07:15:01',
'2015-07-16 07:15:07', '2015-07-16 07:15:14',...]
It includes several days.
I want to select all the rows (all times) of a particular days without specifically knowing the actual time intervals.
For example: Between 2015-07-16 07:00:00
and 2015-07-16 23:00:00
I tried the approach outlined here: here
But df[date_from:date_to]
outputs:
KeyError: Timestamp('2015-07-16 07:00:00')
So it wants exact indices. Furthermore, I don't have a date
column. Only an index with the dates.
What is the best way to select a whole day by just providing a date 2015-07-16
and then how could I select a specific time range within a particular day?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…