Re: [Numpy-discussion] index of a value in an array

2010-10-06 Thread Jonathan Rocher
t; To: numpy-discussion@scipy.org > Cc: snezana.pe...@glcuk.com > Subject: [Numpy-discussion] index of a value in an array > > Hi All, > > Given an array such as: > > array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) > > How can I find the index of a particular num

Re: [Numpy-discussion] index of a value in an array

2010-10-06 Thread Benjamin Root
On Wed, Oct 6, 2010 at 7:23 AM, Nicolas Bigaouette wrote: > On Wed, Oct 6, 2010 at 5:26 AM, Chris Withers wrote: > >> Hi All, >> >> Given an array such as: >> >> array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) >> >> How can I find the index of a particular number in the array? >> >> (ie: if it was a list, I

Re: [Numpy-discussion] index of a value in an array

2010-10-06 Thread Chris Withers
On 06/10/2010 14:53, Thomas, Brian (GE Energy) wrote: > For e.g. to find index of number 1 in array a, you can say > idx = where(a==1) Exactly what we were looking for, thanks! Chris ___ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://ma

Re: [Numpy-discussion] index of a value in an array

2010-10-06 Thread Thomas, Brian (GE Energy)
Behalf Of Chris Withers Sent: Wednesday, October 06, 2010 5:27 AM To: numpy-discussion@scipy.org Cc: snezana.pe...@glcuk.com Subject: [Numpy-discussion] index of a value in an array Hi All, Given an array such as: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) How can I find the index of a particular

Re: [Numpy-discussion] index of a value in an array

2010-10-06 Thread Nicolas Bigaouette
On Wed, Oct 6, 2010 at 5:26 AM, Chris Withers wrote: > Hi All, > > Given an array such as: > > array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) > > How can I find the index of a particular number in the array? > > (ie: if it was a list, I'd do [1,2,3,4].index(3)) > > cheers, > > Chris > _

[Numpy-discussion] index of a value in an array

2010-10-06 Thread Chris Withers
Hi All, Given an array such as: array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9]) How can I find the index of a particular number in the array? (ie: if it was a list, I'd do [1,2,3,4].index(3)) cheers, Chris ___ NumPy-Discussion mailing list NumPy-Discussion@sc