I am searching for a neat representation for creating a mask to use for array indexing, I Have 2 vectors, one represents the data I am interested in, and the other contains data itself. I tried to get this working as follows:
dataINeed = np.arange(3)
-array([0,1,2])
data = random.randint(10,size = (10))
-array([5,7,9,1,5,3,7,1,2,0])
mask = data in dataINeed
- array([False,False,False,True,False,False,False,True,True,True])
I know this might be achievable using set operations but I could not figure out the reciepe to get out such result. Any help on this?