Apply expanding window on subsections of dataframe

I have a dataframe like this key1 day feat 0 a 1 None 1 a 2 A 2 a 3 None 3 a 4 A 4 b 1 A 5 b 2 None 6 b 3 None 7 b 4 A I would like the apply an expanding window with the count function over the… Read More Apply expanding window on subsections of dataframe