geography.py 文件源码

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

项目:hydro 作者: hydrogeog 项目源码 文件源码
def distance_matrix(x0, y0, x1, y1):
    '''Distance matrix for IDW calculation'''
    obs = np.vstack((x0, y0)).T
    interp = np.vstack((x1, y1)).T

    # Make a distance matrix between pairwise observations
    # Note: from <http://stackoverflow.com/questions/1871536>
    d0 = np.subtract.outer(obs[:,0], interp[:,0])
    d1 = np.subtract.outer(obs[:,1], interp[:,1])
    return np.hypot(d0, d1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号