title: Iterating over a numpy array
body: <p>Is there a less verbose alternative to this:</p>
  
  <pre><code>for x in xrange(array.shape[0]):
      for y in xrange(array.shape[1]):
          do_stuff(x, y)
  </code></pre>
  
  <p>I came up with this:</p>
  
  <pre><code>for x, y in itertools.product(map(xrange, array.shape)):
      do_stuff(x, y)
  </code></pre>
  
  <p>Which saves one indentation, but is still pretty ugly.</p>
  
  <p>I'm hoping for something that looks like this pseudocode:</p>
  
  <pre><code>for x, y in array.indices:
      do_stuff(x, y)
  </code></pre>
  
  <p>Does anything like that exist?</p>