Вот способ сделать это на основе цикла.Я был бы взволнован, если бы у кого-то был способ, который лучше использует панд.
import pandas as pd
data = {'Event': ['Start','Going','Stop','Start','Stop','Start','Start','Going','Going','Going','Stop','Stop','Start','Stop']}
df = pd.DataFrame(data)
cycle = 0
new_cycle = True
cycles = []
for x in df.Event:
if new_cycle and x == 'Start':
new_cycle = False
cycle += 1
elif x == 'Stop':
new_cycle = True
cycles.append(cycle)
df['cycles'] = cycles
print(df)
Вывод
Event cycles
0 Start 1
1 Going 1
2 Stop 1
3 Start 2
4 Stop 2
5 Start 3
6 Start 3
7 Going 3
8 Going 3
9 Going 3
10 Stop 3
11 Stop 3
12 Start 4
13 Stop 4