title: How to sort a list based on the output of numpy's argsort function
body: <p>I have a list like this:</p>
  
  <pre><code> myList = [10,30,40,20,50]
  </code></pre>
  
  <p>Now I use <code>numpy's argsort</code> function to get the indices for the sorted list:</p>
  
  <pre><code>import numpy as np
  so = np.argsort(myList)
  </code></pre>
  
  <p>which gives me the output:</p>
  
  <pre><code>array([0, 3, 1, 2, 4])
  </code></pre>
  
  <p>When I want to sort an array using <code>so</code> it works fine:</p>
  
  <pre><code>myArray = np.array([1,2,3,4,5])
  myArray[so]
  array([1, 4, 2, 3, 5])
  </code></pre>
  
  <p>But when I apply it to another list, it does not work but throws an error</p>
  
  <pre><code>myList2 = [1,2,3,4,5]
  myList2[so]
  </code></pre>
  
  <blockquote>
    <p>TypeError: only integer arrays with one element can be converted to an
    index</p>
  </blockquote>
  
  <p>How can I now use <code>so</code> to sort another list without using a for-loop and without converting this list to an array first?</p>