I know there is a method for a Python list to return the first index of something:
>>> l = [1, 2, 3] >>> l.index(2) 1
Is
You can also convert a NumPy array to list in the air and get its index. For example,
l = [1,2,3,4,5] # Python list a = numpy.array(l) # NumPy array i = a.tolist().index(2) # i will return index of 2 print i
It will print 1.