def nearest_neighbours(self, point, n):
"""
Return the indices of the n nearest neighbours to the point.
"""
stellar_parameters = _recarray_to_array(self.stellar_parameters)
distances = np.sum(((point - stellar_parameters) \
/ np.ptp(stellar_parameters, axis=0))**2, axis=1)
return distances.argsort()[:n]
评论列表
文章目录