小编Jam*_*s.F的帖子

无法使用我的代码获取 Choropleth 地图:请指导谢谢

我收到此错误:不推荐使用 choropleth 方法。而是使用具有相同参数的新 Choropleth 类。有关如何执行此操作,请参阅示例笔记本“GeoJSON_and_choropleth”。

with open('C:/Users/abcdef/Desktop/world_countries.json') as data_file:
    data = json.load(data_file)

world_geo = data
world_map = folium.Map(location=[0, 0], zoom_start=2, tiles = 'Mapbox Bright')
world_map.choropleth(
    geo_data = world_geo,
    data = canadamap,
    columns = ['Country', 'Total'],
    key_on = 'feature.properties.name',
    fill_color = 'YlOrRd', 
    fill_opacity = 0.7, 
    line_opacity = 0.2,
    legend_name = 'Immigration to Canada'
)

world_map
Run Code Online (Sandbox Code Playgroud)

我没有使用上面的代码获得 Choropleth Map;相反,我得到

choropleth 方法已被弃用。而是使用具有相同参数的新 Choropleth 类。有关如何执行此操作,请参阅示例笔记本“GeoJSON_and_choropleth”。

python json dictionary choropleth

2
推荐指数
1
解决办法
4414
查看次数

标签 统计

choropleth ×1

dictionary ×1

json ×1

python ×1