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