如何找到两个 numpy 数组之间完全匹配的行索引。例如:
x = np.array(([0,1],
[1,0],
[0,0]))
y = np.array(([0,1],
[1,1],
[0,0]))
Run Code Online (Sandbox Code Playgroud)
这应该返回:
matches = [0,2] # Match at row no 0 and 2
Run Code Online (Sandbox Code Playgroud) numpy ×1