Counting successive occurrences of numbers satisfying certain conditions in python
<p>I have a specific data set that reads like </p>

<pre><code>array([   2.1,    3. ,  179.1,    1.9,    2.6,  425.8,    1.7,    3.1,
          4. ,  144. ,    2.2,    2.3,    5.3,  135.5,    2. ,    2.7,
      .....])]
</code></pre>

<p>Here I want to count the successive occurrences of numbers below 6 and save them in specific counters. For example, in the first three numbers there are two numbers that are continuously below 6 before a bigger number appears. So counter2 would get an addition of 1. If three numbers occur continuously like that, then counter3 would be incremented by 1 (as in the 2nd row) and so on. Are there any functions to do it in python, if not how do I proceed? Thanks in advance. </p>
