2021-07-05
阅读量:
2445
python报错:AttributeError: 'Series' object has no attribute 'passengers',我这个条形图显示不出来是怎么回事
问:
python报错:AttributeError: 'Series' object has no attribute 'passengers',我这个条形图显示不出来是怎么回事
答:
这是因为这里的year_group是series,year.group.passengers是dataframe的取值方法,series只有一列数据,
通过这种方法取值会报错,如果要对该series绘图,可直接执行:
year_group.plot(kind='barh')






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
1条评论