On Wed, Oct 6, 2010 at 5:26 AM, Chris Withers <chris@simplistix.co.uk> 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 mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Try with numpy.where(array == value) and plain "array == value"
IIRC, the first will return an array the size of the found elements and the second will return an array (or list?) of True/False.
Either can be used as "index = numpy.where()" and "index = (array == value)" and then "array[index]".
N