I have a df with two columns, timestamp & eventType.
timestamp is ordered in chronological order, and eventType can be either ['start', 'change', 'end', resolve].['start', 'change'] denotes the start of an event
['end','resolve'] denotes the end of an event
createdTime actionName
2020-03-16 18:28:14 start
2020-03-17 19:12:42 end
2020-03-18 19:56:10 change
2020-03-19 21:29:13 change
2020-03-20 21:42:06 end
2020-03-21 18:28:14 start
2020-03-21 19:12:42 resolve
2020-03-22 19:56:10 change
2020-03-22 21:29:13 change
2020-03-23 21:42:06 end
I wish to calculate the time delta between the each start/change event to the next end/resolve event.
- An event can have several start/change statuses before it is resolved, thus an event would need to take the initial start/change status as the 1st start/change event time.
- The output would need to be a list of time deltas taken for each event in the df
Thanks in advance :)
Edit The expected outcome should be a list containing each time taken for each event.
event_times = ['24:44:28', '49:45.56', '0:44:28', '25:45:56']