interpolator.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:smhr 作者: andycasey 项目源码 文件源码
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]
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号