您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

python-2.7 – 不能使用scipy.stats

5b51 2022/1/14 8:22:10 python 字数 1879 阅读 565 来源 www.jb51.cc/python

使用scipy.stats时,我得到一个错误.在导入scipy后的脚本中. AttributeError: 'module' object has no attribute 'stats' 在脚本编辑器中,我可以在输入scipy后点击统计数据.从下拉菜单中, 在python控制台中我无法从下拉菜单中选择python.stats,它不在那里. 我正在使用pandas 2.7和SciPy 0.13.0

概述

AttributeError: 'module' object has no attribute 'stats'

在脚本编辑器中,我可以在输入scipy后点击统计数据.从下拉菜单中,
在python控制台中我无法从下拉菜单中选择python.stats,它不在那里.
我正在使用pandas 2.7和SciPy 0.13.0
这是为什么?
任何已知问题?

Scipy和许多其他大型软件包一样,不会自动导入所有模块.如果我们想使用scipy的子包,那么我们需要直接导入它们.

但是,一些scipy子包加载其他scipy子包,因此例如导入scipy.stats也会导入大量其他包.但是我从不依赖它来使命名空间中的子包可用.

在许多使用scipy的软件包中,首选模式是导入子包以使其名称可用,例如:

>>> from scipy import stats,optimize,interpolate


>>> import scipy
>>> scipy.stats
Traceback (most recent call last):
  File "<stdin>",line 1,in <module>
AttributeError: 'module' object has no attribute 'stats'
>>> scipy.optimize
Traceback (most recent call last):
  File "<stdin>",in <module>
AttributeError: 'module' object has no attribute 'optimize'

>>> import scipy.stats
>>> scipy.optimize
<module 'scipy.optimize' from 'C:\Python26\lib\site-packages\scipy\optimize\__init__.pyc'>

总结

以上是编程之家为你收集整理的python-2.7 – 不能使用scipy.stats全部内容,希望文章能够帮你解决python-2.7 – 不能使用scipy.stats所遇到的程序开发问题。


如果您也喜欢它,动动您的小指点个赞吧

除非注明,文章均由 laddyq.com 整理发布,欢迎转载。

转载请注明:
链接:http://laddyq.com
来源:laddyq.com
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。


联系我
置顶