I have a numpy array and a list as follows
y=np.array([[1],[2],[1],[3],[1],[3],[2],[2]])
x=[1,2,3]
I would like to return a tuple of arrays each of which contains the indices of each element of x in y. i.e.
(array([[0,2,4]]),array([[1,6,7]]),array([[3,5]]))
Is this possible to be done in a vectorized fashion(without any loops)?
xguaranteed to be iny?xare guaranteed to be inyyandxin your actual use case?