[Matrix-SIG] array.index() in NumPy?

Yoon, Hoon (CICG - NY Program Trading) HYoon@exchange.ml.com
Tue, 6 Oct 1998 18:32:05 -0400


I do:

  a = arrayrange(10)
  nonzero(equal(a, 5))

  Of course be prepared for mult matches, if you have many 5 in a.
Hope this helps,

Hoon,

> -----Original Message-----
> From:	Just van Rossum 
> Sent:	Tuesday, October 06, 1998 5:44 PM
> To:	matrix-sig@python.org
> Subject:	[Matrix-SIG] array.index() in NumPy?
> 
> How do I do the equivalent of
> 
> >>> a = range(10)
> >>> a.index(5)
> 5
> >>>
> 
> with NumPy?
> 
> Thanks!
> 
> Just
> 
> 
> 
> _______________________________________________
> Matrix-SIG maillist  -  Matrix-SIG@python.org
> http://www.python.org/mailman/listinfo/matrix-sig