如何在geodash2(Python)中的一个值中编码纬度和经度?

问题描述 投票:0回答:1

我想像这样编码纬度和经度:

location_start = geohash2.encode(lat_start,lon_start, g)

并得到此错误:

ValueError: The truth value of a Series is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all().

我不知道我的价值观,他们所处的格式或geodash2是否有问题。

我应该在哪里使用a.empty,a.bool(),a.item(),a.any()或a.all()?

python encode
1个回答
1
投票

此错误意味着您尝试传入lat_start或lon_start或g不是浮点值而是传递一系列值。请检查你的lat_start,lon_start和g。

例如:enter image description here

您可以在两个系列中压缩它们:enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.