[SciPy-dev] percentileofscore in svn
josef.pktd at gmail.com
josef.pktd at gmail.com
Sat Nov 22 09:49:17 EST 2008
On Sat, Nov 22, 2008 at 3:01 AM, <josef.pktd at 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