[SciPy-dev] percentileofscore in svn

josef.pktd@gmai... josef.pktd@gmai...
Sat Nov 22 08:49:17 CST 2008


On Sat, Nov 22, 2008 at 3:01 AM,  <josef.pktd@gmail.com> wrote:

>>>> percentileofscorein([1,1,1,1],1)  # yours
> 62.5
>>>> percentileofscore([1,1,1,1],1)  # wikipedia
> 50.0
>>>> percentileofscore([1,1,1,1,1,2,2,2,2,2],1)  # wikipedia
> 25.0
>>>> percentileofscorein([1,1,1,1,1,2,2,2,2,2],1)  # yours
> 30.0
>>>> percentileofscorein([1,1,1],1)  # yours
> 66.666666666666657
>>>> percentileofscore([1,1,1],1)  # wikipedia
> 50.0
>>>> percentileofscorein([1,1,1,1,1,2,2,2,2,2],2)  # yours
> 80.0
>>>> percentileofscore([1,1,1,1,1,2,2,2,2,2],2)  # wikipedia
> 75.0
>

Actually, these numbers make perfect sense are rank orderings. Last
night, I was thinking too much in terms of the [0,1] interval.

I merged the two versions, and made "rank" as default, because it has
better backwards compatibility. I also added tests.

How if percentileofscore could handle a vector of scores at the same
time, then this function would be really useful.

Josef


More information about the Scipy-dev mailing list