jangles
jangles

Reputation: 323

How can I remove a datetime index values from a pandas data frame that are in between 6:00 p.m. and 9:00 a.m.?

So I have a data frame with a date time index that looks like this:

2020-11-10 11:20:00-5:00
...
2020-11-13 11:43:00-5:00

And I want to remove the entire row from every column that has a date time that is in between 6:00 p.m. and 9:00 a.m. for each day.

Thanks in advance.

Upvotes: 0

Views: 198

Answers (1)

Quang Hoang
Quang Hoang

Reputation: 150815

You can use between_time :

df.between_time('9:00', '18:00')

Upvotes: 2

Related Questions