Indexing State Changes in Python nparray
<p>I have steps taken from walkers and increases in pressure for each step.  I want to determine the start and stop of each step and the time it occurred.  This code works great so far to determine when the pressure rises or falls below a threshold (foot lands and lifts off).  Now I have true/false states in the above_threshold array.  </p>

<pre><code>data = np.loadtxt('junk.csv',delimiter=',',skiprows=1)
Fz = data

sigma = 5                       
threshold = 30                  
above_threshold = gaussian_filter(Fz, sigma=sigma) &gt; threshold
</code></pre>

<p>I am new to Python, and am wondering if there is an efficient way to build a new array that tells me the index of when the state change from false to true (for the first step start), then true to false (for the end of the first step).  And, for the start and stops for the next steps that follow.</p>

<p>Thanks in advance, 
Scott</p>
