title: Counting loops/cycles of numbers in Python
body: <p>Trying to count machine cycles. I need help populating the ID column with some Python code. Thanks for your help.</p>
  
  <p>Every time the Cycle restarts at 1, I would like ID to represent that new cycle from 1 to N.</p>
  
  <pre><code>    Cycle   ID
         1    1
         2    1
         …    1
        35    1
  
         1    2
         2    2
         …    2
       457    2
  
         1    3
         2    3
         …    3
       128    3
  </code></pre>