title: Sort 3D eigenvector array using eigenvalues
body: <p>I am trying to re-order a tensor of eigenvalues and eigenvectors in numpy in descending order. I have partially used <a href="https://stackoverflow.com/a/8093043/6436977">this answer</a> to do so.</p>
  <p>I am now trying to do the ordering on an array of eigenvalues of shape <code>(32448,3)</code> and eigenvectors of shape <code>(32448,3,3)</code> respectively. Here is the code that I am currently using:</p>
  <pre><code># compute eigenvalues and eigenvectors using numpy
  eigenvalues, eigenvectors = eigh(struct)
  
  # sort eigenvalues and eigenvectors in descending order of eigenvalues
  idx = np.argsort(eigenvalues, axis=1)[:,::-1]
  
  print(idx.shape)
  # (32448, 3)
  
  eigenvalues = eigenvalues[:,idx]
  eigenvectors = eigenvectors[:,:,idx]
  </code></pre>
  <p>Computing the indexes goes fine, however as soon as the line <code>eigenvalues = eigenvalues[:,idx]</code> executes, my program pretty much breaks; it hangs up and I have to terminate it.</p>