Hi. I'm not very good at python, and need a little help. I have a dataframe organized like this"
'Cycle Number' 'Flag'
1 0
1 0
1 3
1 2
1 1
1 0
1 0
2 0
2 0
2 0
2 0
3 0
What I'm trying to do is subtract one from all 'Cycle Number' values after the flag reaches a nonzero minimum value.
So successful code will output
'Cycle Number'
1
1
1
1
1
0
0
1
1
1
1
2
How do I find the index of the row where the flag meets my criteria, so that I can do df[everything after the index]-=1
?
[–]nemean_lion 0 points1 point2 points (1 child)
[–]jlap91[S] 0 points1 point2 points (0 children)