title: How to return a subarray of a multidimensional array in Python?
body: <p>I need to be able to return a part of a multidimensional array, but I don't know how to do this in a correct way. The way I do it seems very naive:</p>
  
  <pre><code>import numpy as np
  a=np.ones([3,3,3,3,3])
  b=np.asarray([2,2])
  c=np.asarray([2,2])
  print a[b[0],b[1],:,c[0],c[1]]
  </code></pre>
  
  <p>and will return</p>
  
  <pre><code>[1,1,1]
  </code></pre>
  
  <p>However what I want is something like this:</p>
  
  <pre><code>a=np.ones([3,3,3,3,3])
  b=np.asarray([2,2])
  c=np.asarray([2,2])
  print a[b,:,c]
  </code></pre>
  
  <p>Which returns the <code>a</code> itself, Although I want it to return <code>[1,1,1]</code> instead.</p>
  
  <p>And I don't know why. How can I read part of an array without specifying element by element but giving the indices of the array I want as a pack?</p>
  
  <p>P.S. Thanks to @hcwhsa, I updated the question to address more specifically what I want.</p>