I have two 2d numpy arrays and want to find where one array is occuring in another one:
big_array = np.array([[1., 2., 1.2], [5., 3., 0.12], [-1., 14., 0.], [-9., 0., 13.]])
small_array= np.array([[5., 3., 0.12], [-9., 0., 13.]])
Then I want to get the indices of the rows of big_array
which are the same as any rows of small_array
. I want to do somthing like np.in1d
for 2d arrays. I mean I want to have:
result= [1, 3]
I already tried the following code but it was not successful:
result=[([any(i == big_array ) for i in small_array])]
In advance, I do appreciate any help.