[SciPy-dev] percentileofscore in svn

Ryan May rmay31@gmail....
Sat Nov 22 12:22:01 CST 2008


josef.pktd@gmail.com wrote:
> On Sat, Nov 22, 2008 at 11:55 AM, Ariel Rokem <arokem@berkeley.edu> wrote:
>> Hi Josef - cool reworking of the function. I am not quite following - what
>> do you mean "handle a vector of scores at the same
>> time"?
>>
>> Ariel
> 
> evaluate for several scores at the same time:
> a = [1,2,3,4,5,6,7,8,9,10]
> percentileofscore(a,[4,5,8])
> or
> percentileofscore(a,np.array([4,5,8]))
> instead of
> for s in [4,5,8]:
>     percentileofscore(a,s)
> 
> For example if "a" are the student grades, then
> percentileofscore(a,a)
> would give you the ranking of every student.
> 
> percentileofscore(a,[4,5,8], kind = 'weak') would provide empirical
> cumulative frequency for 4,5,8
> 
> But I didn't see a way of gaining much in the function compared to the
> simple for loop.

But you could at least perform this loop within the function so that the
user can get the ease of functionality and not have to write the loop
his/herself.

My $0.02.

Ryan

-- 
Ryan May
Graduate Research Assistant
School of Meteorology
University of Oklahoma


More information about the Scipy-dev mailing list