0

I need to calculate the operating time between failures of a equipment, respecting its operating schedule.

Basically I have a corrective maintenance dataframe with the start and end time in the format of the attached image:

enter image description here

I need a python code that calculates the time in hours between the end and start of each maintenance excluding times outside the operation calendar (that is, I need the time that it worked and did not fail).

The operation calendar is:

  • Monday: from 07:15 am to 05:00 pm and after 10:20 pm to 11:59 pm
  • Tuesday, Wednesday, Thursday and Friday: from 12:00 am to 5:00 pm and from 10:20 pm to 11:59 pm
  • Saturday: from 12:00 am to 7:15 am

Can someone help me?

  • what have you tried so far ? the question needs sufficient code for a [minimal reproducible example](https://stackoverflow.com/help/minimal-reproducible-example) – D.L Jul 28 '23 at 16:01

0 Answers0