title: How to get the index of the sorted list for the original list in Python?
body: <p>The <code>argsort</code> function of numpy returns the original index of the sorted list. 
  Now I want the index of the sorted list for the original list. Is there 
  a function or an elegant way to do this ?</p>
  
  <p>For example:</p>
  
  <pre><code>&gt;&gt;&gt; import numpy as np
  &gt;&gt;&gt; a = np.array([2, 8 , 5, 6])
  &gt;&gt;&gt; np.argsort(a)
  array([0, 2, 3, 1])
  &gt;&gt;&gt; function(a)
  array([0, 3, 1, 2])
  </code></pre>