Re: [Numpy-discussion] Coverting ranks to a Gaussian

2008-06-10 Thread Dag Sverre Seljebotn
Keith Goodman wrote: > I'd rather not pull in a scipy dependency for one function if there is > a numpy alternative. I think it is funny that you picked up on my > brief mention of scipy and called it unreasonable. > (I didn't follow this exact discussion, arguing from general principles here a

Re: [Numpy-discussion] Coverting ranks to a Gaussian

2008-06-10 Thread Keith Goodman
On Tue, Jun 10, 2008 at 12:56 AM, Anne Archibald <[EMAIL PROTECTED]> wrote: > 2008/6/9 Keith Goodman <[EMAIL PROTECTED]>: >> Does anyone have a function that converts ranks into a Gaussian? >> >> I have an array x: >> import numpy as np x = np.random.rand(5) >> >> I rank it: >> x = x

Re: [Numpy-discussion] Coverting ranks to a Gaussian

2008-06-10 Thread Anne Archibald
2008/6/9 Keith Goodman <[EMAIL PROTECTED]>: > Does anyone have a function that converts ranks into a Gaussian? > > I have an array x: > >>> import numpy as np >>> x = np.random.rand(5) > > I rank it: > >>> x = x.argsort().argsort() >>> x_ranked = x.argsort().argsort() >>> x_ranked > array([3, 1,

Re: [Numpy-discussion] Coverting ranks to a Gaussian

2008-06-09 Thread Keith Goodman
On Mon, Jun 9, 2008 at 7:35 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Mon, Jun 9, 2008 at 21:06, Keith Goodman <[EMAIL PROTECTED]> wrote: >> On Mon, Jun 9, 2008 at 4:45 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >>> On Mon, Jun 9, 2008 at 18:34, Keith Goodman <[EMAIL PROTECTED]> wrote: D

Re: [Numpy-discussion] Coverting ranks to a Gaussian

2008-06-09 Thread Pierre GM
On Monday 09 June 2008 22:30:09 Keith Goodman wrote: > On Mon, Jun 9, 2008 at 7:02 PM, Pierre GM <[EMAIL PROTECTED]> wrote: > > There's a scipy.stats.mstats.rankdata() that take care of both ties and > > missing data. Missing data are allocated a rank of either 0 or the > > average rank, depending

Re: [Numpy-discussion] Coverting ranks to a Gaussian

2008-06-09 Thread Robert Kern
On Mon, Jun 9, 2008 at 21:06, Keith Goodman <[EMAIL PROTECTED]> wrote: > On Mon, Jun 9, 2008 at 4:45 PM, Robert Kern <[EMAIL PROTECTED]> wrote: >> On Mon, Jun 9, 2008 at 18:34, Keith Goodman <[EMAIL PROTECTED]> wrote: >>> Does anyone have a function that converts ranks into a Gaussian? >>> >>> I ha

Re: [Numpy-discussion] Coverting ranks to a Gaussian

2008-06-09 Thread Keith Goodman
On Mon, Jun 9, 2008 at 7:02 PM, Pierre GM <[EMAIL PROTECTED]> wrote: > On Monday 09 June 2008 22:06:24 Keith Goodman wrote: >> On Mon, Jun 9, 2008 at 4:45 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > >> > There are subtleties in computing ranks when ties are involved. Take a >> > look at the implem

Re: [Numpy-discussion] Coverting ranks to a Gaussian

2008-06-09 Thread Pierre GM
On Monday 09 June 2008 22:06:24 Keith Goodman wrote: > On Mon, Jun 9, 2008 at 4:45 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > > There are subtleties in computing ranks when ties are involved. Take a > > look at the implementation of scipy.stats.rankdata(). > > Good point. I had to deal with ties

Re: [Numpy-discussion] Coverting ranks to a Gaussian

2008-06-09 Thread Keith Goodman
On Mon, Jun 9, 2008 at 4:45 PM, Robert Kern <[EMAIL PROTECTED]> wrote: > On Mon, Jun 9, 2008 at 18:34, Keith Goodman <[EMAIL PROTECTED]> wrote: >> Does anyone have a function that converts ranks into a Gaussian? >> >> I have an array x: >> import numpy as np x = np.random.rand(5) >> >> I

Re: [Numpy-discussion] Coverting ranks to a Gaussian

2008-06-09 Thread Robert Kern
On Mon, Jun 9, 2008 at 18:34, Keith Goodman <[EMAIL PROTECTED]> wrote: > Does anyone have a function that converts ranks into a Gaussian? > > I have an array x: > >>> import numpy as np >>> x = np.random.rand(5) > > I rank it: > >>> x = x.argsort().argsort() >>> x_ranked = x.argsort().argsort() >>>

[Numpy-discussion] Coverting ranks to a Gaussian

2008-06-09 Thread Keith Goodman
Does anyone have a function that converts ranks into a Gaussian? I have an array x: >> import numpy as np >> x = np.random.rand(5) I rank it: >> x = x.argsort().argsort() >> x_ranked = x.argsort().argsort() >> x_ranked array([3, 1, 4, 2, 0]) I would like to convert the ranks to a Gaussian w