尝试复制Gapminder气泡图时出错

时间:2018-09-22 17:38:19

标签: python bubble-chart

我只是Python的初学者,我一直在尝试复制此动画的气泡图:

https://www.kaggle.com/aashita/guide-to-animated-bubble-charts-using-plotly/notebook

    enter code here 
# import our packages 
import pandas as pd 

# Define the dataset and the columns
dataset = 'gapminderDataFiveYear.csv'
x_column = 'gdpPercap'
y_column = 'lifeExp'
bubble_column = 'country'
time_column = 'year'

# Get the years in the dataset
years = dataset[time_column].unique()

我收到此错误:

TypeError:字符串索引必须为整数

...有什么建议吗?

0 个答案:

没有答案