我希望得到一个主numpy的2D阵列A的交叉行的索引,用另一个B.指数相交numpy的2D阵列的行
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
当本应返回[0,-2 ,3]基于阵列A的指数。
谢谢!
很好!但我有50个1000行的数组,这个循环变得 不可行这样的大阵,谢谢! –