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

Jonathan Helmus jjhelmus@gmail....
Tue Dec 4 10:44:47 CST 2012


On 12/04/2012 11:26 AM, Pauli Virtanen wrote:
> 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.
>
NumPy's implementation is pure python and quite straightforward, I'll 
put together a pull request to include similar functionality in SciPy.  
Adding the limit optional parameter shouldn't be too hard.

- Jonathan Helmus


More information about the SciPy-User mailing list