Suppose that I have two 2-D arrays as follows:
array([[3, 3, 1, 0],
[2, 3, 1, 3],
[0, 2, 3, 1],
[1, 0, 2, 3],
[3, 1, 0, 2]], dtype=in
I can't think of a numpy specific way to do it, but here's what I would do with regular lists:
>>> L1= [[3, 3, 1, 0],
... [2, 3, 1, 3],
... [0, 2, 3, 1],
... [1, 0, 2, 3],
... [3, 1, 0, 2]]
>>> L2 = [[0, 3, 3, 1],
... [0, 2, 3, 1],
... [1, 0, 2, 3],
... [3, 1, 0, 2],
... [3, 3, 1, 0]]
>>> L1 = {tuple(row):i for i,row in enumerate(L1)}
>>> answer = []
>>> for i,row in enumerate(L2):
... if tuple(row) in L1:
... answer.append((L1[tuple(row)], i))
...
>>> answer
[(2, 1), (3, 2), (4, 3), (0, 4)]