title: Count groups of values in Pandas series
body: <p>I have a Pandas (<code>pandas==0.23.4</code>) datetime-indexed dataframe <code>df</code> with a column named <code>value_id</code>.</p>
  
  <p><code>value_id</code> contains groups of float values (either <code>5.0</code> or <code>6.0</code>) and groups of <code>NaN</code>. I would like to count the number of continuous groups for both <code>5.0</code> and <code>6.0</code>. The groups must contain at least three consecutive values.</p>
  
  <p>For example:</p>
  
  <pre><code>In [1]: print df.value_id
  timestamp
  2019-01-06 17:42:08    NaN
  2019-01-06 17:45:08    5.0
  2019-01-06 17:48:08    5.0
  2019-01-06 17:51:08    5.0
  2019-01-06 17:54:08    NaN
  2019-01-06 17:57:08    NaN
  2019-01-06 18:00:08    NaN
  2019-01-06 18:03:08    NaN
  2019-01-06 18:06:08    NaN
  2019-01-06 18:09:08    NaN
  2019-01-06 18:12:08    6.0
  2019-01-06 18:15:08    6.0
  2019-01-06 19:54:09    NaN
  2019-01-06 19:57:09    5.0
  2019-01-06 20:00:08    5.0
  2019-01-06 20:03:08    5.0
  2019-01-06 20:06:09    NaN
  2019-01-06 20:09:08    NaN
  2019-01-06 20:12:08    NaN
  2019-01-06 20:15:09    NaN
  2019-01-06 20:18:08    NaN
  2019-01-06 20:21:09    NaN
  2019-01-06 20:24:09    NaN
  2019-01-07 19:09:07    NaN
  2019-01-07 19:12:06    NaN
  2019-01-07 19:15:06    5.0
  2019-01-07 19:18:06    5.0
  2019-01-07 19:21:07    5.0
  2019-01-07 19:24:07    5.0
  2019-01-07 19:27:07    NaN
  2019-01-07 19:30:07    NaN
  2019-01-07 19:33:06    NaN
  2019-01-07 19:36:07    NaN
  2019-01-07 19:39:07    NaN
  2019-01-07 19:42:06    NaN
  2019-01-07 19:45:06    NaN
  2019-01-07 19:48:06    NaN
  2019-01-07 19:51:06    6.0
  2019-01-07 19:54:07    6.0
  2019-01-07 19:57:06    6.0
  Name: value_id, dtype: float64
  </code></pre>
  
  <p>If I had two variables named <code>count1</code> (for the 5.0 value groups) and <code>count2</code> (for the 6.0 value groups), the resulting counts assigned for the above example would be:</p>
  
  <p><code>count1</code>: 3</p>
  
  <p><code>count2</code>: 1</p>