suppose I have two array
arr1 and arr2
arr1 = ["ABC","DEF","GHI","XYZ"]
arr2 = ["ABC","XYZ"]
I need the index of element of arr2 in arr1.
required result =[0,3]
I am able to do this using pandas but need an effective way of doing maybe by numpy.
A = pd.series(arr1)
B = pd.series(arr2)
B.map(lambda x: np.where(A==x)[0][0]).tolist()