Pandas groupby: Count the number of occurences within a time range for each group,df['cumsum'] = df['WIN1'].cumsum()