I have a dataframe with two columns as below:
Var1Var2 a 28 b 28 d 28 f 29 f 29 e 30 b 30 m 30 l 30 u 31 t 31 t 31
I\'d
Something like this:
(df.Var2.diff() != 0).cumsum()