I have arrays of a = np.arange(21).reshape(7,3)
and b = np.array([[3,4,5], [9,10,11]])
a = [[ 0 1 2]
[ 3 4 5]
[ 6 7 8]
[ 9 10 11]
[12 13 14]
[15 16 17]
[18 19 20]]
b = [[3 4 5]
[9 10 11]]
I want to find the row numbers of b within a. So, I am looking to get 1 and 3 as my output. I know that for finding the indices, I can use the np.where()
or np.argwhere()
. However, I don't know exactly if we can use them for this problem or I have to use other functions. I tried c = np.argwhere(a == b)
but it gives error.