title: How do I get the index of a specific percentile in numpy / scipy?
body: <p>I have looked <a href="https://stackoverflow.com/a/2374662/391161">this answer</a> which explains how to compute the value of a specific percentile, and <a href="https://stackoverflow.com/a/12414469/391161">this answer</a> which explains how to compute the percentiles that correspond to each element.</p>
  
  <ul>
  <li><p>Using the first solution, I can compute the value and scan the original array to find the index.</p></li>
  <li><p>Using the second solution,  I can scan the entire output array for the percentile I'm looking for.</p></li>
  </ul>
  
  <p>However, both require an additional scan if I want to know the index (in the original array) that corresponds to a particular percentile (or the index containing the element <strong>closest</strong> to that index). </p>
  
  <p>Is there is more direct or built-in way to get the index which corresponds to a percentile?</p>
  
  <p>Note: My array is not sorted and I want the index in the <strong>original, unsorted array</strong>.</p>