我有地理json格式的边界
{'type': 'FeatureCollection',
'features': [{'type': 'Feature',
'properties': {'STATEFP10': '04',
'ZCTA5CE10': '85347'},
'geometry': {'type': 'Polygon',
'coordinates': [[[-113.587371, 32.77836],
[-113.587269, 32.77819],
[-113.590707, 32.776887],
...
我还有一些数据
data
POSTCODE X
0 85347 0
1 85356 0
我正试图策划一个基本的合唱团。 如果我这样做,我会得到
AttributeError: 'NoneType' object has no attribute 'get'
以下代码段中有什么错误?这是一个复制粘贴的示例。。。 我已经确保边界键和数据帧邮政编码完全相同
m = folium.Map( zoom_start=8)
# Add the color for the chloropleth:
folium.Choropleth(
geo_data=boundaries,
name='choropleth',
data=data,
columns=['POSTCODE','X'],
key_on='features.properties.ZCTA5CE10',
fill_color='BuPu',
#fill_opacity=0.7
).add_to(m)
folium.LayerControl().add_to(m)
m
为参数
feature.properties.ZCTA5CE10
上的键_尝试功能而不是功能来自Choroplethdocstring
相关问题 更多 >
编程相关推荐