When using the "in" operator to check whether an element exist in a numpy array, is there any way to also get the index of that element? Thank you
Asked
Active
Viewed 367 times
0
-
If you actually did mean numpy, https://stackoverflow.com/questions/432112/is-there-a-numpy-function-to-return-the-first-index-of-something-in-an-array – Ry- Sep 13 '16 at 02:32
-
A recent SO about `in` for `numpy` arrays. http://stackoverflow.com/questions/39452843/in-operator-for-numpy-arrays. For 1d arrays there is a `np.in1d` function. For multidimensional arrays the question is harder. – hpaulj Sep 13 '16 at 04:18