I have dataframe like this:
point | switch_on |
---|---|
A | True |
B | True |
C | True |
A | False |
D | False |
N | True |
O | False |
O | False |
S | False |
I want to add another column which will determine groups of rows that contain the same boolean before switching. Like this:
point | switch_on | group |
---|---|---|
A | True | 1 |
B | True | 1 |
C | True | 1 |
A | False | 2 |
D | False | 2 |
N | True | 3 |
O | False | 4 |
O | False | 4 |
S | False | 4 |