Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/303.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Pandas 未在jupyter中渲染的choropleth和geojson叶_Pandas_Jupyter_Geojson_Choropleth_Folium - Fatal编程技术网

Pandas 未在jupyter中渲染的choropleth和geojson叶

Pandas 未在jupyter中渲染的choropleth和geojson叶,pandas,jupyter,geojson,choropleth,folium,Pandas,Jupyter,Geojson,Choropleth,Folium,当所有33个伦敦行政区都包含在geojson文件中时,我无法在jupyter中显示一个对开本地图 但是 如果geojson文件中包含更少的行政区,我可以得到要显示的对开本地图。(最多23个) 如果我将地图保存为html文件并单独打开它,它就可以正常工作 下面是代码的版本(仅使用前23个行政区) 以下是不起作用的版本: m = folium.Map(location=[51.5, -0.1], zoom_start=10) m.choropleth( geo_data=

当所有33个伦敦行政区都包含在geojson文件中时,我无法在jupyter中显示一个对开本地图

但是

如果geojson文件中包含更少的行政区,我可以得到要显示的对开本地图。(最多23个)

如果我将地图保存为html文件并单独打开它,它就可以正常工作

下面是代码的版本(仅使用前23个行政区)

以下是不起作用的版本:

m = folium.Map(location=[51.5, -0.1], zoom_start=10)

    m.choropleth(
        geo_data= geo_london, # all 33 boroughs
        data=df["Underground"],
        columns=["LA",'Underground'],
        key_on='feature.properties.name',
        fill_color='BuPu',
        fill_opacity=0.9,
        line_opacity=0.2,
        legend_name='Underground Useage',
        highlight=True
    )
其他需要注意的事项:

  • 我在python中使用json解析了geojson文件,因此geo_london是一个 字典
  • 如果我执行m.save('mymap.html')并在第二次打开映射 这个版本也很好用
  • 如果我不在数据库中使用数据,我也会遇到同样的问题 chorepleth,但使用folium.GeoJson(geo_london).add_to(m)
  • 叶0.5.0
  • 该数据是一个熊猫数据系列

您可能正在描述此处解释的错误(如果在Chrome上覆盖的图像数>80,Folium将不显示任何内容)。
尝试使用不同的浏览器,如Firefox或Safari。

这很奇怪。我想知道您是否收到了警告,例如,IOPub数据速率超过了,并且被抑制了。我发现这是google chrome的问题!在狩猎旅行中似乎没有什么问题。你可以在这里看到我的笔记本——我在chrome上看不到地图,但在safari上可以看到。哦,好的。你在Chrome中运行Jupyter并在Safari中打开html文件?在Chrome中打开的html文件(在我使用m.save()保存地图之后)。但是在jupyter工作不会显示地图。当我在chrome中使用nbviewer时,我也看不到地图,但它在safari上的加载效果很好。看起来和这个问题一样
m = folium.Map(location=[51.5, -0.1], zoom_start=10)

    m.choropleth(
        geo_data= geo_london, # all 33 boroughs
        data=df["Underground"],
        columns=["LA",'Underground'],
        key_on='feature.properties.name',
        fill_color='BuPu',
        fill_opacity=0.9,
        line_opacity=0.2,
        legend_name='Underground Useage',
        highlight=True
    )