0

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

hpaulj
  • 221,503
  • 14
  • 230
  • 353
Mohammad Amin
  • 444
  • 1
  • 5
  • 14
  • 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

0 Answers0