scipy.spatial
scikits.ann
tree.query(...)
scipy.spatial.KDTree.query
docs
Returns
-------
d : array of floats
The distances to the nearest neighbors.
If x has shape tuple+(self.m,), then d has shape tuple if
k is one, or tuple+(k,) if k is larger than one. Missing
neighbors are indicated with infinite distances. If k is None,
then d is an object array of shape tuple, containing lists
of distances. In either case the hits are sorted by distance
(nearest first).
i : array of integers
The locations of the neighbors in self.data. i is the same
shape as d.
[1,1]
distance to nearest: 0.0
index of nearest in original array: 0
array
y = x on the range [1,50]
tree.query([1,1], k=2)