grp = (isone != idx.to_series().diff().eq(1)).cumsum()
df.loc[idx, 'Event_number'] = pd.Categorical(grp).codes + 1
How to count the number of time intervals that meet a boolean condition within a pandas dataframe?