代码之家  ›  专栏  ›  技术社区  ›  Sejal Gupta

叶绿体不显色

  •  0
  • Sejal Gupta  · 技术社区  · 3 年前

    Geojson文件: https://raw.githubusercontent.com/sejal234/heatmaps_by/main/Zip_Codes.geojson

    https://raw.githubusercontent.com/sejal234/heatmaps_by/main/oyzipsattempt.csv (这在我的代码中标记为新)

    我想创建一个 chloroplet h显示每小时OY(机会青年)的数量 zipcode 在休斯顿。

    以下代码:

      n = folium.Choropleth(
                     geo_data=r'https://raw.githubusercontent.com/sejal234/heatmaps_by/main/Zip_Codes.geojson',
                        data=new,
                        columns=['ZIPCODE','oy_count'], 
                        key_on='feature.properties.ZIP_CODE', 
                        fill_color='YlGn',
                        nan_fill_color="White", 
                        fill_opacity=1,
                        line_opacity=0.5,
                        legend_name='Num of OY', #title of the legend
                        highlight=True,
                        line_color='black')
            n.add_to(htx_map2) 
            folium.LayerControl().add_to(htx_map2)
            htx_map2
    

    应返回 chloropleth 在黄绿色比例上,但返回以下(空)地图:

    enter image description here

    我做错了什么?

    0 回复  |  直到 3 年前