Re: [Numpy-discussion] numpy function to compute sample ranks

2008-11-02 Thread Wes McKinney
Try rankdata in scipy.stats On Nov 2, 2008, at 1:35 PM, Keith Goodman wrote: > On Sun, Nov 2, 2008 at 10:24 AM, Abhimanyu Lad > <[EMAIL PROTECTED]> wrote: >> Is there a direct or indirect way in numpy to compute the sample >> ranks of a >> given array, i.e. the equivalent of rank() in R. >> >

Re: [Numpy-discussion] numpy function to compute sample ranks

2008-11-02 Thread Keith Goodman
On Sun, Nov 2, 2008 at 10:24 AM, Abhimanyu Lad <[EMAIL PROTECTED]> wrote: > Is there a direct or indirect way in numpy to compute the sample ranks of a > given array, i.e. the equivalent of rank() in R. > > I am looking for: > rank(array([6,8,4,1,9])) -> array([2,3,1,0,4]) > > Is there some clever

[Numpy-discussion] numpy function to compute sample ranks

2008-11-02 Thread Abhimanyu Lad
Hi, Is there a direct or indirect way in numpy to compute the sample ranks of a given array, i.e. the equivalent of rank() in R. I am looking for: rank(array([6,8,4,1,9])) -> array([2,3,1,0,4]) Is there some clever use of argsort() that I am missing? Thanks, Abhi _