test.py 文件源码

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

项目:pdist 作者: oliviaguest 项目源码 文件源码
def test_dist_itslef(self):
        """Compary cdist to GeoPy."""
        X = [[0, 10], [4, 2]]  # Just some points. I've no idea where on globe.
        c = cdist(X[0], X[1])
        string_geopy = '{}'.format(great_circle(X[0], X[1]))
        float_geopy = float(string_geopy[:-3])
        self.assertTrue(np.round(c) == np.round(float_geopy))

        X = [[34.0522, 118.2437],  # Lon Angeles
             [37.7749, 122.4194]]  # San Francisco
        c = cdist(X[0], X[1])
        string_geopy = '{}'.format(great_circle(X[0], X[1]))
        float_geopy = float(string_geopy[:-3])
        self.assertTrue(np.round(c) == np.round(float_geopy))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号