在使用folium的choropleth图中显示无错误但空白

2024-06-23 18:35:35 发布

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

我从choropleth地图得到一个空白输出。你知道吗

我尝试了不同版本的连接jsan数据,但是没有任何效果,因为输出仍然是空的

state_geo = f'san-francisco.geojson'
folium.Choropleth(
geo_data=state_geo,
data=df2,
columns= ['Neighbourhood','Count'],
key_on='feature.properties.DISTRICT',
fill_color='YlOrRd',
fill_opacity=0.7,
line_opacity=0.2,
legend_name='Crime rate in san Francisco'
).add_to(sanfran_map)

df2型

邻里数 海景14303 中央17666 英格尔赛德11594 19503年任务 北部20100 公园8699 里士满8922 南部28445 塔拉瓦尔11325 里脊肉9942

还有json文件

https://cocl.us/sanfran_geojsonenter link description here

enter image description here

预期结果是一个choropeth映射


Tags: 版本datahere地图descriptionfill空白geo

热门问题