Is there a fast way to find all indices where a 2d array is inside a 3d array?
I have this 3d numpy array:
arr = np.array([
[[0,1],[0,2],[0,3],[0,4],[0,4],[0,5],[0,5],[0,5],[0,5],[0,5]],
[[0,1],[0,2],[0,2],[0,2],[0,3],[0,4],[0,4],[0,4],[0,5],[0,5]],
[[0,1],[0,2],[0,3],[0,3],[0,3],[0,4],[0,4],[0,5],[0,5],[0,5]]
])
And I would like to find all indices where [0,4] occurs.
I've tried this one:
whereInd = np.argwhere(arr == np.array([0,4]))
but it doesn't work. The expected result is:
[[0 3],[0 4],[1 5],[1 6],[1 7],[2 5],[2 6]]
Another question is, will this be fast? Because I would like to use it for a (10000,100,2) array.