I'm running this in Jupyter Notebook. I'll attach my full code. I'm using a csv file from Kaggle to plot the cumulative coronavirus cases throughout different countries in the world.
Here's the link to the Kaggle dataset download: https://www.kaggle.com/sudalairajkumar/novel-corona-virus-2019-dataset I'm using the "covid_19_data.csv" file.
import chart_studio.plotly as py
import plotly.graph_objs as go
import pandas as pd
from plotly.offline import download_plotlyjs, init_notebook_mode, iplot, plot
init_notebook_mode(connected = True)
cf.go_offline()
df = pd.read_csv('covid_19_data.csv')
data = dict(type = 'choropleth',
locations = df['Country/Region'],
z = df['Confirmed'],
text = df['Province/State'],
colorbar = {'title':'Cases of COVID-19'} )
layout = dict(title = '2020 Global Coronavirus Cases', geo = dict(showframe = False, projection = {'type':'natural earth'}))
choromap = go.Figure(data = [data],layout = layout)
iplot(choromap)
The output is a gray map of the world. There is a legend with color, and a title as well. I'm confused why the data is not being plotted!
Any help is appreciated!