我画了一张漂亮的美国地图。我已经使用Choropleth
Folium
folium.Choropleth(
geo_data=boundaries,
name='choropleth',
data=df,
columns=['state','NR'],
key_on='feature.id',
fill_color='Blues',
threshold_scale=a_non_unform_log_scale,
fill_opacity=0.7
).add_to(m)
这是我想要的,但是我想给值0一种特殊的透明颜色。例如。在图像中,许多状态为黑色,因为它们在df
中有一个null / nan条目。我可以使缺失状态透明吗?
是,可以。您可以执行以下操作: