The idea is to switch between the set of True and False conditioned by 2 columns.
For example
Column A | Column B | Column C |
---|---|---|
False | False | False |
False | False | False |
True | False | True |
False | False | True |
True | False | True |
True | False | True |
True | False | True |
False | False | True |
False | True | False |
False | True | False |
False | False | False |
False | False | False |
False | True | False |
True | False | True |
False | False | True |
False | False | True |
What I would like to generate is the "Column C".
"Column A" changes "Column C" from ("False" to "True").
"Column B" changes "Column C" from ("True" to "False").
Triggering by the First "True"
I finally have the answer to this by making use of cumsum().
If anyone have the simpler solution, please share. Thanks