'''
perstate = df[df['State'] != '']['State'].value_counts().to_dict()
data = [dict(
type = 'choropleth',
autocolorscale = False,
colorscale = 'Blues',
reversescale = True,
locations = list(perstate.keys()),
locationmode = 'USA-states',
text = list(perstate.values()),
z = list(perstate.values()),
marker = dict(
line = dict(
color = 'rgb(255, 255, 255)',
width = 2)
),
)]
layout = dict(
title = 'Bachelor contestants by State',
geo = dict(
scope = 'usa',
projection = dict(type = 'albers usa'),
countrycolor = 'rgb(255, 255, 255)',
showlakes = True,
lakecolor = 'rgb(255, 255, 255)')
)
figure = dict(data = data, layout = layout)
iplot(figure)
'''
This is giving me the following:
TypeError
Traceback (most recent call last)
<ipython-input-294-8cdc028c4fa9> in <module>
7 colorscale = 'Blues',
8 reversescale = True,
----> 9 locations = list(perstate.keys()),
10 locationmode = 'USA-states',
11 text = list(perstate.values()),
TypeError: 'list' object is not callable
It was working earlier today and I haven't changed anything. Why could this be happening? I am using a notebook in Kaggle. I am trying to take the column 'State' which has the states abbreviations and I want to make a heat map.