我正在使用 geopy,我想将计算出的距离保存在一个数组中。这是我到目前为止所尝试的:
import geopy.distance
for i in dfP.itertuples():
coords_1 = (-20.91, 144.3517)
coords_2 = (i.Latitude, i.Longitude) #(-20.51, 144.3517)
dist = geopy.distance.distance(coords_1, coords_2).km
print(dist)