Posts

Showing posts with the label folium

Folium library error in choropleth

Folium library error in choropleth Am using folium library with an open data set from kaggle, map.choropleth(geo_path=country_geo, data=plot_data, columns=['CountryCode', 'Value'], key_on='feature.id', fill_color='YlGnBu', fill_opacity=0.7, line_opacity=0.2, legend_name=hist_indicator ) The above part of the code is giving me the following error: TypeError: choropleth() got an unexpected keyword argument 'geo_path' When I replace geo_path with geo_data I get this error: geo_path geo_data JSONDecodeError: Expecting value: line 7 column 1 (char 6) 2 Answers 2 geo_path doesn't work because it is not a parameter for choropleth. You are correct in replacing it with geo_data. Your second error is likely due to non-existent or incorrectly formatted geojson file. From http://python-visualization.github.io/folium/doc...