[Numpy-discussion] array membership test?

Mark Wendell mark.wendell@gmail....
Tue May 5 21:37:00 CDT 2009

Is there a numpy equivalent of python's membership test (eg,  "5 in
[1,3,4,5]" returns True)? I'd like a quick way to test if a given
number is in an array, without stepping through the elements
individually. I realize this can be tricky with floats, but if there
is such a thing for ints, that would be great.


Mark Wendell

More information about the Numpy-discussion mailing list