According to this question
Python pandas cumsum() reset after hitting max
I want to reset cumsum after hiting max or reset when ID change.
Transaction_ID Time TimeDelta CumSum[ms]
1 00:00:04.500 00:00:00.000 000
1 00:00:04.600 00:00:00.100 100
1 00:00:04.762 00:00:00.162 262
2 00:00:05.543 00:00:00.781 1043
2 00:00:09.567 00:00:04.024 5067
2 00:00:10.654 00:00:01.087 6154
2 00:00:14.300 00:00:03.646 9800
3 00:00:14.532 00:00:00.232 10032
3 00:00:16.500 00:00:01.968 12000
3 00:00:17.543 00:00:01.043 13043