Folium返回错误验证\u位置和<listcomp>

2024-05-16 23:31:27 发布

您现在位置:Python中文网/ 问答频道 /正文

在这段代码中,我将zipcodes存储在“zipcodes”中。通过函数find_location,我可以在ElasticSearch中找到这个zipcode的纬度和经度。然后,将此lat和lon添加到新阵列(点)。 之后,所有点将一次性添加到阵列中,并最终使用多段线函数创建贴图

# create for each address of the chosen postcodes the lat and lon matrix
map = folium.Map(location=[53,6], zoom_start = 8)
points = []

for postcodes in tour:
    location = find_location(postcodes)
    points.append(location)
    folium.Marker(location)
folium.PolyLine(points).add_to(map)
map

但是,它返回Folium实用程序中的错误:

第94行在验证单元位置

第94行输入<;上市公司>

我在网上找不到任何东西,所以也许有人有线索


Tags: the函数代码mapforlocationfindelasticsearch