My data format is the following:
id eventSource eventType timestamp
0 102 sensor1 received 2021-10-06 13:45:51
1 102 sensor1 startingCalculation 2021-10-06 13:45:55
2 102 sensor1 endedCalculation 2021-10-06 13:46:00
3 103 sensor2 received 2021-10-06 13:46:00
4 103 sensor2 startingCalculation 2021-10-06 13:46:04
5 103 sensor2 endedCalculation 2021-10-06 13:46:10
I need help with the following task:
I want to group by the Id eventSource and eventType and show diffs between the received
and endedCalculation
events for each of them like so:
id eventSource diff
0 102 sensor1 9
0 103 sensor2 10
And so on ...
I am kind of stuck in the groupby stage,
Thank you for anyone trying to help