Why does mapping in Folium with over 100 Circle Markers result in a blank map?

前端 未结 1 389
你的背包
你的背包 2021-01-24 06:07

I\'m working on producing a series of maps for an animated presentation using Folium and my code (when plotting over 100 circles) always ends in a blank map. If I decrease the n

相关标签:
1条回答
  • 2021-01-24 06:45

    The OP's dataset contains a row with an apostrophe/single quote in the Station_Name column/Series that wasn't causing an error but wasn't rendering the map either.

    filter = merged_hourly['Station_Name'].str.contains("'")
    print(merged_hourly.loc[filter,'Station_Name'])
    
    101    E 143/ST MARY'S
    Name: Station_Name, dtype: object
    

    Solution was to replace the apostrophe with ' so the map renders and Station_Name correctly shows up in the popup

    merged_hourly['Station_Name'] = merged_hourly['Station_Name']
                                                  .str.replace("'", "'")
    
    0 讨论(0)
提交回复
热议问题