[SciPy-User] equivalent of R quantile() function in scipy

Pauli Virtanen pav@iki...
Tue Dec 4 10:26:55 CST 2012


04.12.2012 18:20, Jonathan Helmus kirjoitti:
> numpy.percentile can can accept a sequence of percentiles as the second
> parameter:
> 
> In [8]: probs = [10.0, 30.0, 50.0, 70.0, 90.0]
> 
> In [9]: a = np.arange(100)
> 
> In [10]: np.percentile(a, probs)
[clip]
> In [11]: [scipy.stats.scoreatpercentile(a, i) for i in probs]
> Out[11]:
[clip]

It could be useful if someone would take a look if that the
implementation in scipy can be easily adapted for that.

-- 
Pauli Virtanen




More information about the SciPy-User mailing list