I have two 1D arrays and I want to find out if an element in one array occurs in another array or not.
For example:
import numpy as np
A = np.array([ 1, 48, 50, 78, 85, 97])
B = np.array([38, 43, 50, 62, 78, 85])
I want:
C = [2,3,4] # since 50 in second array occurs in first array at index 2,
# similarly 78 in second array occurs in first array in index 3,
# similarly for 85, it is index 4
I tried:
accuracy = np.searchsorted(A, B)
But it gives me undesirable results.