小编Zhe*_*gic的帖子

从各个距离创建距离矩阵

我有一个按正确顺序排列的铁路中每两个相邻车站之间的距离增加列表。我需要做的是为每两个站之间的距离创建一个矩阵。这是这个列表。



    +-------------------------+-------------------------+---------------+
    |    Departure Station    |     Arrival Station     | distance in m |
    +-------------------------+-------------------------+---------------+
    |                         | San Francisco           |           0.0 |
    | San Francisco           | 22nd Street             |   2521.949349 |
    | 22nd Street             | Bayshore                |     5875.8986 |
    | Bayshore                | South San Francisco     |   6690.161279 |
    | South San Francisco     | San Bruno               |   2964.853585 |
    | San Bruno               | Millbrae Transit Center |   4154.792069 |
    | Millbrae Transit Center | Broadway                |   2549.171972 |
    | Broadway                | Burlingame …
Run Code Online (Sandbox Code Playgroud)

python dictionary numpy matrix pandas

4
推荐指数
1
解决办法
66
查看次数

标签 统计

dictionary ×1

matrix ×1

numpy ×1

pandas ×1

python ×1