faster scipy.percentileofscore ?

Vincent Davis vincent at vincentdavis.net
Mon Feb 2 13:36:18 EST 2009


Did not know about http://www.scipy.org/Mailing_Lists but did not look,

Thanks for the help
Vincent Davis




On Mon, Feb 2, 2009 at 11:28 AM, Robert Kern <robert.kern at gmail.com> wrote:
> On 2009-02-02 12:08, Vincent Davis wrote:
>>
>> Currently I am using the following:
>> pgrades = [scipy.percentileofscore(grades,x) for x in grades]
>>
>> I need the percentile of each number in grades. The problem is that it
>> takes a long time (a few minutes) because there are 15,000 items in
>> the list.
>> does anyone know is there is a faster way?
>
> from scipy import stats
> pgrades = (stats.rankdata(grades)-1) / (len(grades)-1) * 100
>
> You will probably want to ask further scipy questions on the scipy mailing
> list.
>
>  http://www.scipy.org/Mailing_Lists
>
> --
> Robert Kern
>
> "I have come to believe that the whole world is an enigma, a harmless enigma
>  that is made terrible by our own mad attempt to interpret it as though it
> had
>  an underlying truth."
>  -- Umberto Eco
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



More information about the Python-list mailing list