【发布时间】:2021-09-15 02:10:49
【问题描述】:
我是新手,什么都不懂。我想创建一个我拥有的每个坐标之间的距离的新列表,point1-point2、point1-point3、point2-point3 的距离列表。
所以我的代码是:
list_of_coords = [(5.55, 95.3175), (3.583333, 98.666667), (-0.95556, 100.36056)]
list_of_distances = [geopy.distance.geodesic(combo).km for combo in combinations(list_of_coords,2)]
anddd 当我尝试运行它时,它说:
TypeError: unsupported operand type(s) for +=: 'int' and 'tuple'
如何让它正常运行?谢谢!
【问题讨论】:
标签: python coordinates typeerror distance geopy