title: Python IndexError: Out of bounds
body: <p>I've created a class of which I pass an image (2D array, 1280x720). It's suppose to iterate through, looking for the highest value:</p>
  
  <pre><code>import bumpy as np
  
  class myCv:
      def maxIntLoc(self,image):
          intensity = image[0,0]  #columns, rows
          coordinates = (0,0)
          for y in xrange(0,len(image)):
              for x in xrange(0,len(image[0])):
                  if np.all(image[x,y] &gt; intensity):
                      intensity = image[x,y]
                      coordinates = (x,y)
          return (intensity,coordinates)
  </code></pre>
  
  <p>Yet when I run it I get the error:</p>
  
  <pre><code>if np.all(image[x,y] &gt; intensity):
  IndexError: index 720 is out of bounds for axis 0 with size 720
  </code></pre>
  
  <p>Any help would be great as I'm new to Python.</p>
  
  <p>Thanks,
  Shaun</p>