geo_pairwise_distance.py 文件源码

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

项目:pairwise_distance 作者: oliviaguest 项目源码 文件源码
def batch_pdist(data_slice):
    # Each data_slice has tuples consisting of two points that we need to
    # find the great circle distance between and their weight:
    partial_sum = 0
    for X, Y, weights in data_slice:
        dist = np.array([])
        zipped = zip(X, Y)
        for x, y in zipped:
            dist = np.append(dist, great_circle(x, y).km)
        partial_sum += np.sum(weights * dist )
    return partial_sum
    # return 10
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号