【发布时间】:2017-07-25 02:36:44
【问题描述】:
我想获取一个主 numpy 二维数组 A 与另一个 B 的相交行的索引。
A = array([[1,2],
[1,3],
[2,3],
[2,4],
[2,5],
[3,4]
[4,5]])
B = array([[1,2],
[3,2],
[2,4]])
result=[0, -2, 3]
##Note that the intercept 3,2 must assign (-) because it is the opposite
这应该根据数组 A 的索引返回 [0, -2, 3]。
谢谢!
【问题讨论】:
标签: python arrays numpy intersect