title: How can I find the indices of the quantiles of an array?
body: <p>I have a numpy array <code>df</code> for which I calculate 10 quantiles using this:</p>
  
  <p><code>np.quantile(df, np.arange(0.1, 1.1, 0.1))</code></p>
  
  <p>which gives:</p>
  
  <p><code>array([0.73518751, 0.73774966, 0.7415471 , 0.74462405, 0.74640229,
         0.74952848, 0.7522163 , 0.75820953, 0.76289489, 0.76954299])</code></p>
  
  <p>But I also wanted to know the indices of these 10 values (or nearest values). Basically, which values reflect the quantiles the closest in the original array.</p>
  
  <p>How can I do this?</p>
  
  <p><code>df</code></p>
  
  <pre><code>array([[0.74472344, 0.72122723, 0.75860745, 0.76498497, 0.70747197,
          0.74813282, 0.74042159, 0.74722695, 0.73554462, 0.75064671,
          0.74331897, 0.74716657, 0.73778194, 0.74615586, 0.76285201,
          0.75964642, 0.73241562, 0.75377691, 0.75396305, 0.75909799,
          0.73139387, 0.74406022, 0.7466802 , 0.74904978, 0.76954299,
          0.74861521, 0.73639923, 0.72030777, 0.76361781, 0.74158204,
          0.75146145, 0.7445026 , 0.75811005, 0.72869432, 0.74437159,
          0.73829693, 0.73757732, 0.75386381, 0.75234902, 0.76638651,
          0.75146788, 0.74095088, 0.72755104, 0.74487853, 0.74637753,
          0.73871291, 0.76512724, 0.75878656, 0.76340133, 0.75192058,
          0.74568671, 0.75875962, 0.74529624, 0.73688561, 0.75444639,
          0.74146557, 0.71298224, 0.76272094, 0.73547828, 0.73585916,
          0.73830914, 0.7449885 , 0.74602336, 0.75998384, 0.7620157 ,
          0.75025225, 0.75024652, 0.74897128, 0.736911  , 0.75200063,
          0.75215942, 0.75381088, 0.74398333, 0.74050236, 0.75152248,
          0.7435388 , 0.75403506, 0.76490963, 0.73895139, 0.74835008,
          0.76352328, 0.74488378, 0.75088626, 0.74712956, 0.76071763,
          0.75406158, 0.73689425, 0.73673624, 0.76328081, 0.73762053,
          0.74111873, 0.74642706, 0.76343733, 0.74263775, 0.73242599,
          0.74470502, 0.74260616, 0.74389631, 0.75280219, 0.73257053]])
  </code></pre>