I am trying to visualize some Covid-19 data (Covid Cases Ratio per Country) using folium module. For some reason a few countries appear to be black on the map, for example United States, and I'm using fill_color="YlGn". What is the problem right here?
import os
import folium
import pandas as pd
states = os.path.join('datas', 'countries.geo.json')
country_covid = os.path.join('datas', 'df.csv')
covid_data = pd.read_csv(country_covid, skiprows=0)
bins = list(covid_data['Cases'].quantile([0, 0.25, 0.5, 0.75, 1]))
m = folium.Map(location=[16, 34], zoom_start=5)
folium.Choropleth(
geo_data=states,
name="choropleth",
data=covid_data,
columns=['Country', 'Cases'],
key_on='feature.properties.ADMIN',
fill_color='YlGn',
fill_opacity=0.7,
line_opacity=0.2,
legend_name='Covid-19 Rate (%)',
bins=bins,
reset=True
).add_to(m)
folium.LayerControl().add_to(m)
m.save(outfile="map1.html")
Check out a screenshot of the map: