I'm trying to visualize some data with Plotly in Jupyter notebook but the choropleth map is not showing up, as you can see from this image.
The data set I'm working on is from https://csbh-dashboard.mckinsey.com/#/data-insights?chart=SP&geo=County&lob=All&metric1=covid_case_count&metric2=covid_death_count_per_100k_pop&tab=Map
I've tried following a few past submissions from here but I have not made any progress. I would appreciate any help in this direction, Thank you.Here is the code so far
import pandas as pd
import plotly.graph_objs as go
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected = True)
df = pd.read_csv('State-level-data_31_07_2021.csv')
df.head()
data = dict(type='choropleth',
locations = df['State'],
locationmode = 'USA-states',
colorscale = 'Greens',
text = df['State Code'],
z = df['Cases of COVID-19'],
colorbar = {'title':"Cases of COVID-19"}
)
layout = dict(title = 'Cases of COVID-19 in USA Map',
geo = dict(scope='usa')
)
choromap = go.Figure(data = [data],layout = layout)
iplot(choromap)
