[SciPy-user] quantile function in scipy

Manu Hack manuhack@gmail....
Sun Feb 24 00:13:53 CST 2008


On Sun, Feb 24, 2008 at 12:58 AM, David Cournapeau
<david@ar.media.kyoto-u.ac.jp> wrote:
>
> Manu Hack wrote:
>  > Hi,
>  >
>  > I'd like to know if there is any function to find the quantiles, given
>  > two lists where one is the value and another the frequency.
>  >
>  > For example, v = [1, 2, 3], freq = [3, 2, 1], then I would like to
>  > have the quantiles for the samples: 1, 1, 1, 2, 2, 3.
>  >
>  > Have browsed around the doc of scipy.stats but didn't get any thing
>  > close.  Thanks a lot.
>  >
>  >
>  Would scipy.stats.percentileofscore solve your problem ?

It's close.  But the problem is that the freq list in my application
is going to be a huge number so to make a list from v and freq to put
in that function may not be feasible.

I looked at the source code, in the comment it suggests the Gnu R
functions.  So I may be using the wtd.quantile under Hmisc library of
R via rpy.

Thanks.

Manu


More information about the SciPy-user mailing list