title: How to count consecutive repetitions in a pandas series
body: <p>Consider the following series, <code>ser</code></p>
  
  <pre><code>date        id 
  2000        NaN
  2001        NaN 
  2001        1
  2002        1
  2000        2
  2001        2
  2002        2
  2001        NaN
  2010        NaN
  2000        1
  2001        1
  2002        1
  2010        NaN
  </code></pre>
  
  <p>How to count the values such that every consecutive number is counted and returned? Thanks.</p>
  
  <pre><code>Count
  NaN     2 
  1       2 
  2       3
  NaN     2
  1       3
  NaN     1
  </code></pre>