[SciPy-user] scipy.stats.percentileofscore : something strange

Matthieu Brucher matthieu.brucher at gmail.com
Thu Dec 13 05:53:40 EST 2007


2007/12/13, Samuel GARCIA <sgarcia at olfac.univ-lyon1.fr>:
>
>
>
> Matthieu Brucher a écrit :
>
>
>
> 2007/12/13, Samuel GARCIA <sgarcia at olfac.univ-lyon1.fr>:
> >
> >  Hi all,
> > I found something strange in scipy.stats.percentileofscore
> > In [1]: from scipy import *
> > In [2]: a = rand(10000)
> > In [3]: stats.percentileofscore(a,.2)
> > Out[3]: 20.0157565073
> >          This OK.
> > In [4]: stats.percentileofscore(a,.0002)
> > Out[4]: 102.898311442
> >             This is strange !!!!!
> >
> >
> This may be a bug
>
>
If you put 0 for the score, a number greater than 100 is returned, so this
is a bug. But for 0.0002, your percentile will be null, you can change the
histbins value (default=10) for a better precision.


I expect this to raise this exception, you cannot take a percentile outside
> [0, 1] (1.4 = 140%)
>
>
> I think that it should return 100 if superior to rigtht limit and 0 if
> inferior to left limit.
> No ?
>


My mistake, I was confused by the interval. I think you are right, but
perhaps someone else will give the answer to this behaviour.
I think you should open a ticket on the TRAC to keep track of this bug.

Matthieu
-- 
French PhD student
Website : http://matthieu-brucher.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
LinkedIn : http://www.linkedin.com/in/matthieubrucher
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20071213/7d20687e/attachment.html>


More information about the SciPy-User mailing list