Reputation: 6081
How can I filter a DataFrame indexed by datetime so that I get only the entries within certain hours of every day?
I am looking for something equivalent to the following R
code for an xts
object
df["09:00:00::17:00:00"]
Upvotes: 16
Views: 18468
Reputation: 28936
You want the between_time
method: http://pandas.pydata.org/pandas-docs/dev/generated/pandas.DataFrame.between_time.html#pandas.DataFrame.between_time
Upvotes: 13