【发布时间】:2014-04-02 05:08:15
【问题描述】:
使用 scipy.stats 时出现错误。在导入 scipy 后的脚本中。
AttributeError: 'module' object has no attribute 'stats'
在脚本编辑器中,我可以在输入 scipy 后单击统计信息。从下拉菜单中, 在 python 控制台中,我无法从下拉菜单中选择 python.stats,它不存在。 我正在使用熊猫 2.7 和 SciPy 0.13.0 这是为什么? 有任何已知问题吗?
【问题讨论】:
-
您是否导入了统计信息,即
from scipy import stats或import scipy.stats。 stats 子包不使用import scipy导入,但您的编辑器可能会这样做以完成制表符。 -
“脚本编辑器”? “下拉菜单”?你用的是什么编辑器?你是怎么安装的?你是怎么安装python的?在终端中,
python -c "import scipy.stats"是否给出错误?另外,显示生成错误的代码,以及导入 scipy.stats 的代码。 -
谢谢,使用 import scipy.stats 有效。
标签: python-2.7 scipy