Re: [Numpy-discussion] Getting indices from numpy array with condition

2008-11-19 Thread Scott Sinclair
2008/11/19 Robert Kern <[EMAIL PROTECTED]>: > On Wed, Nov 19, 2008 at 01:31, David Warde-Farley <[EMAIL PROTECTED]> wrote: >> On 18-Nov-08, at 3:06 PM, Robert Kern wrote: >> >>> I like to discourage this use of where(). For some reason, back in >>> Numeric's days, where() got stuck with two functio

Re: [Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread Robert Kern
On Wed, Nov 19, 2008 at 01:31, David Warde-Farley <[EMAIL PROTECTED]> wrote: > On 18-Nov-08, at 3:06 PM, Robert Kern wrote: > >> I like to discourage this use of where(). For some reason, back in >> Numeric's days, where() got stuck with two functionalities. nonzero() >> is the preferred function f

Re: [Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread David Warde-Farley
On 18-Nov-08, at 3:06 PM, Robert Kern wrote: > I like to discourage this use of where(). For some reason, back in > Numeric's days, where() got stuck with two functionalities. nonzero() > is the preferred function for this functionality. IMO, where(cond, > if_true, if_false) should be the only use

Re: [Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread Robert Kern
On Tue, Nov 18, 2008 at 04:48, David Warde-Farley <[EMAIL PROTECTED]> wrote: > On 18-Nov-08, at 5:29 AM, Nicolas ROUX wrote: > >> Hi, >> >> Maybe this is not so clever, but I can't find it in the doc. >> I need to get all indices/index of all occurrences of a value in a >> numpy >> array >> >> >> A

Re: [Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread David Warde-Farley
On 18-Nov-08, at 5:29 AM, Nicolas ROUX wrote: > Hi, > > Maybe this is not so clever, but I can't find it in the doc. > I need to get all indices/index of all occurrences of a value in a > numpy > array > > > As example: > > a = numpy.array([1,2,3],[4,5,6],[7,8,9]) > I need to get the indice/inde

Re: [Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread Francesc Alted
A Tuesday 18 November 2008, Nicolas ROUX escrigué: > Hi, > > Maybe this is not so clever, but I can't find it in the doc. > I need to get all indices/index of all occurrences of a value in a > numpy array > > > As example: > > a = numpy.array([1,2,3],[4,5,6],[7,8,9]) > I need to get the indice/inde

[Numpy-discussion] Getting indices from numpy array with condition

2008-11-18 Thread Nicolas ROUX
Hi, Maybe this is not so clever, but I can't find it in the doc. I need to get all indices/index of all occurrences of a value in a numpy array As example: a = numpy.array([1,2,3],[4,5,6],[7,8,9]) I need to get the indice/index of all array elements where a[a>3] Any fast/easy way to write this