Say I have a dataframe that looks like this:
Event Transition Date From To
ESS-123 2018-12-28 10:27:35.913 Planning In Progress
ESS-123 2019-04-20 10:51:07.857 In Progress Deferred
HTO-254 2019-04-04 15:19:06.013 Planning In Progress
HTO-254 2019-05-05 10:35:03.083 In Progress Not in work
HTO-254 2019-05-24 10:55:12.280 Work Planned In Progress
AEW-8465 2018-10-01 09:40:34.070 Work Planned In Progress
AEW-8465 2018-10-01 10:30:07.993 In Progress Suspended
AEW-8465 2018-10-25 12:22:13.203 Drafted In Progress
AEW-8465 2019-02-05 15:58:13.900 In Progress Suspended
I want to be able to calculate the time in state of 'In Progress' for each Event. So I have to be able to filter by Event, aggregate a time in state, and add it to a new column. I can't even wrap my head around where to start. Any help by anyone would be greatly appreciated.