human
Getting the indices of several elements in a NumPy array at once
assistant
Here is some code to get the indices in array `b` of each element appearing in array `a`

np.in1d(b, a).nonzero()[0]

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.