I have a pandas DataFrame that contains 1s and 0s in its rows. I want to count the number of group of consecutive 1s in my DataFrame. I repeat I am not asking for number of consecutive 1s, there are lots of examples on the web about it.
To be more exact:
Lets say the row of my pd.DataFrame is:
index value
0 0
1 1
2 1
3 0
4 0
5 1
6 0
7 1
8 0
9 1
I want output to be 4