For a numpy
array of shape (n, 2)
, n points with 2 coordinates, what is the best way (fastest for large n) to test if a particular point is already in the array. E.g.
test_point = np.array([1, 2])
array_A = array([[1, 3], [2, 2], [2, 1]]) # test on this should return False
array_B = array([[1, 2], [2, 2], [2, 1]]) # test on this should return True