I have two arrays and I am trying to return a new array that equals the intersection of my original two arrays. The two original arrays should be of the same length. For example, if I have:
arr1 = np.array([(255, 255, 255), (255, 255, 255)])
arr2 = np.array([(255, 255, 255), (255, 255, 255)])
I should get:
intersectedArr = ([(255, 255, 255), (255, 255, 255])
However, if I have:
arr1 = np.array([(100, 100, 100), (255, 255, 255)])
arr2 = np.array([(255, 255, 255), (255, 255, 255)])
I should get
([(255, 255, 255)])
So far i've tried:
intersectedArr = np.intersect1d(arr1, arr2)
but this returns [255] instead of the expected ([(255, 255, 255)])
Can someone help? Thanks in advance!
intersectedArr = np.intersect1d(arr1, arr2)