关于运行seaborn 出现TypeError: slice indices must be integers or None or have an __index__ method错误。

seaborn是非常常用的一种可视化统计分析工具,对于使用anaconda安装python的小伙伴,使用seaborn包时容易出现如下错误:TypeError: slice indices must be integers or None or have an __index__ method错误。例如在调用distplot函数的时候,会出现如下错误:

进入Python,输入

import statsmodels
print(statsmodels.__version__)

输出结果:

0.6.1

anaconda 自动安装的版本太低需要升级,升级之后将不会出现此错误,进入anaconda指令窗口,输入:

conda update statsmodels

安装完成后即可解决之前的问题。

发布了10 篇原创文章 · 获赞 2 · 访问量 614

猜你喜欢

转载自blog.csdn.net/fangfanglovezhou/article/details/98787707
今日推荐