I have two arrays:
arr1 = np.array((
np.array([ 32, 32, 32, 32, 32, 39], dtype=np.int64),
np.array([449, 451, 452, 453, 454, 463], dtype=np.int64)))
arr2 = np.array((
np.array([ 39, 34, 32, 32, 37, 32], dtype=np.int64),
np.array([463, 393, 453, 452, 261, 449], dtype=np.int64)))
In these 2D arrays, the:
- First array (
arr1[0],arr2[0]) are x-axis values - Second array (
arr1[1],arr2[1]) are y-axis values
I would like to find the xy pairs that match between the two arrays.
Some clarifications:
arr1andarr2will not necessarily be of equal length. They could be different lengths- X value and Y value pairs could be in any ordering. Sorting or alignment between arrays is not expected
- Duplicates of the same X value and Y value pairs will not occur in the same array
In the above examples, the pairs that are the same between the two arrays are:
- X = 32, Y = 449
- X = 32, Y = 452
- X = 32, Y = 453
- X = 39, Y = 463
I've tried to use np.intersect1d and some other functions I found.