我希望得到一個主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行的數組,這個循環變得 不可行這樣的大陣,謝謝! –