Python Choropleth贴图不显示
下面的代码未显示所附图像中所示的预期输出。我的代码遗漏了什么Python Choropleth贴图不显示,python,choropleth,Python,Choropleth,下面的代码未显示所附图像中所示的预期输出。我的代码遗漏了什么 gjson=r'https://cocl.us/sanfran_geojson' Sanfransisco=folium.Map(location=[37.77, -122.42], zoom_start=12, tiles='Mapbox Bright') Sanfransisco.choropleth( geo_data=gjson, data=df, columns=['Neighbourhood','C
gjson=r'https://cocl.us/sanfran_geojson'
Sanfransisco=folium.Map(location=[37.77, -122.42], zoom_start=12, tiles='Mapbox Bright')
Sanfransisco.choropleth(
geo_data=gjson,
data=df,
columns=['Neighbourhood','Count'],
key_on='feature.properties.District',
fill_color='YlOrRd',
fill_opacity=0.7,
line_opacity=0.2,
legend_name='Crime rate in Sanfransisco'
文件“”,第11行
legend_name='Sanfransisco的犯罪率'
^
SyntaxError:解析时出现意外的EOF函数上需要一个右括号。试试这个:
Sanfransisco.choropleth(
geo_data=gjson,
data=df,
columns=['Neighbourhood','Count'],
key_on='feature.properties.District',
fill_color='YlOrRd',
fill_opacity=0.7,
line_opacity=0.2,
legend_name='Crime rate in Sanfransisco')
我们无法判断您的代码是否存在任何其他问题,因为我们不知道您的数据帧的形式