I have two sorted arrays h and M:
h = np.array(['blue', 'red', 'white'])
M = np.array(['blue', 'green', 'orange', 'red', 'white'])
and would like to find the indices at which each element of h appears in M
Can I np.where for this?
Also, it can be the case that an element of h might not appear in M and in this case, I don't require the index for it. The elements do not repeat.