I would like to create a Choropleth map in Python using Folium library.
This is the dataset:
df_new_count2
Reviewer Country Count Original Number Percentage
0 Greece 191 3352 0.056981
1 Belgium 338 5991 0.056418
2 Germany 429 7843 0.054698
The Json file used is the following: https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DV0101EN/labs/Data_Files/world_countries.json
This is the code I used:
world_map = folium.Map(location=[40, 0], zoom_start=1.5)
folium.Choropleth( geo_data='https://s3-api.us-geo.objectstorage.softlayer.net/cf-courses-data/CognitiveClass/DV0101EN/labs/Data_Files/world_countries.json',
name='choropleth',
data=df_new_count2,
columns=['Reviewer Country','Percentage'],
key_on='feature.properties.name',
fill_color='YlOrRd',
fill_opacity=0.7,
line_opacity=0.2,
legend_name='Percentage of people'
).add_to(world_map)
folium.LayerControl().add_to(world_map)
world_map
The map is displaying but everything is black, the colors are not showing.
Does anyone know what the issue might be? Thanks in advance for your time.