title: Pandas dataframe: specific intervals in for loop
body: <p>I'm trying to run a for loop with specific intervals.
  It's a big data file and I need the cumulative sum to a <strong>specific number</strong> of every single product.
  In the last column I can see when a new Product starts.</p>
  
  <p>For example:</p>
  
  <p>Specific sum for second Product, 7: 6.1 + 1.0 > 7 --> mark this row (1.0) and jump to the next Product with Change '1'.</p>
  
  <pre><code>for i in range (0, 3):
      ....
      ....
  
  
  DATE         PRODUCT        PRICE   Change
  01.01.2017   NEG_00_12       2.0      0
  01.01.2017   NEG_00_12       8.9      0
  01.01.2017   NEG_12_24       6.1      1
  01.01.2017   NEG_12_24       1.0      0
  01.01.2017   NEG_12_24       2.3      0
  02.01.2017   NEG_00_12       4.1      1
  02.01.2017   NEG_00_12       5.0      0
  </code></pre>