title: Change stepsize of for loop while in loop
body: <p>is there a method where I can change the stepsize of a for loop, while I am in the loop?</p>
  
  <p>E.g. this doesn't seem to work:</p>
  
  <pre><code>stepsize = 1.
  for i in np.arange(0.,10.,stepsize):
     print i
     if i &gt; 5:
        print "change"
        stepsize = 0.5
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>0.0
  1.0
  2.0
  3.0
  4.0
  5.0
  6.0
  change
  7.0
  change
  8.0
  change
  9.0
  change
  </code></pre>