I have the following code to plot a choropleth Map in python.
data = [dict(
type="choropleth",
autocolorscale= True,
locations = df[statename],
z = df[z].astype(float),
locationmode = 'USA-states',
text = df[state],
marker = dict(
line = dict (
color = 'rgb(255,255,255)',
width = 2
)),
colorbar = dict(title = title)
)]
layout = dict(title = title,
geo=dict(scope="usa",showlakes = True,lakecolor = 'rgb(255, 255, 255)'))
iplot(go.Figure(data=data,layout=layout),validate=False)
Is it possible to plot the map using just the State Names as input to locations or is it necessary to have the two Letter State Codes. When i use the state codes it works but when i use the state names it just gives me an empty map.