Here's some example data for the problem I'm working on:
index Quarter Sales_Growth
0 2001q1 0
1 2002q2 0
2 2002q3 1
3 2002q4 0
4 2003q1 0
5 2004q2 0
6 2004q3 1
7 2004q4 1
The Sales_Growth column tells me if there was indeed sales growth in the quarter or not. 0 = no growth, 1 = growth.
First, I'm trying to return the first Quarter when there were two consecutive quarters of no sales growth.
With the data above this answer would be 2001q1.
Then, I want to return the 2nd quarter of consecutive sales growth that occurs AFTER the initial two quarters of no growth.
The answer to this question would be 2004q4.
I've searched but the closest answer I can find I can't get to work: https://stackoverflow.com/a/26539166/3225420
I am a Pandas beginner.