import os
import seaborn as sns
print(os.listdir("../input"))
df=pd.read_csv("../input/gun-violence-data_01-2013_03-2018.csv")
//GUN violence dataset from kaggle//
from plotly.offline import init_notebook_mode, iplot
init_notebook_mode(connected=True)
import plotly.graph_objs as go
b=df.state.value_counts().sort_values()
ba=pd.DataFrame(b)
ans=ba.reset_index(inplace=True)
//creating a dataframe only containing the state names of USA and its count//
data = [ dict(type='choropleth',
autocolorscale = False,
locations = ba['index'],
z = ba['state'],
locationmode = 'USA-states',
text = ba['index'],
colorscale='Viridis' ) ]
layout = dict(
title = 'US',
geo = dict(
scope='usa',
projection=dict( type='albers usa' ),
showlakes = True,
lakecolor = 'rgb(255, 165, 255)'),)
fig = go.Figure( data=data,layout=layout )
iplot(fig)
However, whenever I run this code, Only a blank image of USA is obtained, which is blank and shows no values. please help!