title: How to import multiple bands from an image into numpy?
body: <p>I'm new to python/numpy. I need to import <em>n</em> bands of data (~125) from a multiband image into an <em>n</em>-dimensional array. Each value is a 16-bit signed integer. Currently I have python code that looks like this:</p>
  
  <pre><code>stream = bytearray()
  
  mbImage = open(filename, mode='rb'); 
  
  while curr &lt;= filesize: 
      mbImage.seek(curr)
      b = mbImage.read(samples * 2)
      stream += b 
      curr += (2 * bands * samples) 
  </code></pre>
  
  <p>How can I convert this code to numpy, so that I can do this for each band? I tried the following, which doesn't work (this includes gdal): </p>
  
  <pre><code>npBandArr = np.array(inDs.GetRasterBand(10).ReadAsArray())
  </code></pre>