title: How to group based on cumulative sum that resets on a condition
body: <p>I have a pandas df with word counts corresponding to articles.  I want to be able to be able to add another column <code>MERGED</code> that is based on groups of articles that have a minimum cumulative sum of 'min_words'.</p>
  <pre><code>df = pd.DataFrame([[  0,  6],
         [  1,  10],
         [  3,   5],
         [  4,   7],
         [  5,  26],
         [  6,   7],
         [  9,   4],
         [ 10, 133],
         [ 11,  42],
         [ 12,   1]], columns=['ARTICLE', 'WORD_COUNT'])
  
  df
  Out[15]: 
     ARTICLE  WORD_COUNT
  0        0           6
  1        1          10
  2        3           5
  3        4           7
  4        5          26
  5        6           7
  6        9           4
  7       10         133
  8       11          42
  9       12           1
  </code></pre>
  <p>So then if <code>min_words = 20</code> this is the desired output:</p>
  <pre><code>    df
  Out[17]: 
     ARTICLE  WORD_COUNT  MERGED
  0        0           6       0
  1        1          10       0
  2        3           5       0
  3        4           7       1
  4        5          26       1
  5        6           7       2
  6        9           4       2
  7       10         133       2
  8       11          42       3
  9       12           1       4
  </code></pre>
  <p>As seen above, it is possible that the final article(s) won't satisfy the min_words condition, and that's ok.</p>