title: Displaying multiple images from a numpy array
body: <p>I have a numpy array (data.npy) which stores multiple sample images. I want to view/ save all the images. I have tried following:</p>
  
  <pre><code>img_array=np.load('data.npy')
  i = 0
  while i &lt; len(img_array):
     plt.imshow(img_array[i], cmap='gray')
     plt.show()
     i += 1
  </code></pre>
  
  <p>but this gives an error: </p>
  
  <pre><code>TypeError: Invalid dimensions for image data
  </code></pre>