title: in-place numpy array sorting according to given index
body: <p>There are some questions that come close, but I haven't found a specific answer to this. I'm trying to do some in-place sorting of a numpy 3D array along a given axis. I don't want simple sorting though, I want to resort the array according to my own index. For example</p>
  
  <pre><code>a = np.random.rand((3,3,3))
  </code></pre>
  
  <p>and let's say I want to resort the last dimension according to the following indices of the old array:</p>
  
  <pre><code>new_order = [1,2,0]
  </code></pre>
  
  <p>I would expect to be able to say:</p>
  
  <pre><code>a[:,:,new_order] = a
  </code></pre>
  
  <p>but this does not behave as expected. Suggestions?</p>