Say that I have a df like this:
Value
0 True
1 True
2 False
3 False
4 False
5 True
6 True
7 False
8 True
9 True
And say that I want to assign each group of True values a label, such that consecutive True values are assigned the same label because they constitute a cluster, whereas False values get always 0:
Value Label
0 True 1
1 True 1
2 False 0
3 False 0
4 False 0
5 True 2
6 True 2
7 False 0
8 True 3
9 True 3
How could I do this in pandas?