I have a dataframe with two datetime columns: ResponseTime and ResolveTime. My requirement is to get the difference between two datetimes in hours. The answer must include only business hours (8:00-18:00) and weekdays. I tried the following questions: Extract Business Days in Time Series using Python/Pandas and Mask timeseries outside business hours. I am new to Time series and I am not sure as to how I should use indexer_between_time. Desired output will be a dataframe like this:
Response Time,Resolve Time,Solving Time
'2013-01-01 04:00:00', '2013-01-01 05:00:00',1
'2013-01-01 04:00:00', '2013-01-01 05:30:00',1.5
Thanks!
Of course, Business Hours package solves the need.Here is the code I found in github and it works perfect. It is also easy to tweak the code to our need. https://github.com/dnel/BusinessHours
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With