【发布时间】:2017-05-04 00:06:24
【问题描述】:
我想获取列表的模式,所以我尝试在 scipy 中使用模式功能,但出现以下错误,
from scipy import stats
a = np.array([[6, 8, 3, 0],
... [3, 2, 1, 7],
... [8, 1, 8, 4],
... [5, 3, 0, 5],
... [4, 7, 5, 9]])
mode(a)
错误信息:
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-9-4f9bea4011df> in <module>()
----> 1 from scipy import stats
2
3 a = np.array([[6, 8, 3, 0],
4 ... [3, 2, 1, 7],
5 ... [8, 1, 8, 4],
c:\python34\lib\site-packages\scipy\stats\__init__.py in <module>()
319 from __future__ import division, print_function, absolute_import
320
--> 321 from .stats import *
322 from .distributions import *
323 from .morestats import *
c:\python34\lib\site-packages\scipy\stats\stats.py in <module>()
178 from scipy._lib.six import callable, string_types
179 from numpy import array, asarray, ma, zeros
--> 180 import scipy.special as special
181 import scipy.linalg as linalg
182 import numpy as np
c:\python34\lib\site-packages\scipy\special\__init__.py in <module>()
599 from __future__ import division, print_function, absolute_import
600
--> 601 from ._ufuncs import *
602
603 from .basic import *
ImportError: DLL load failed: can not find module.
这里有什么问题? 虽然我可以导入统计数据,并使用它的模式功能,但我也想弄清楚为什么 scipy.stats 不能使用?该模块的 python 3.4 是否有一些变化?
【问题讨论】:
-
我无法重现该问题。您可能想分享您的
SciPy版本。 -
它是0.16.0,当我导入scipy时,没有错误,但是scipy.stats出错,
-
如果您仍然遇到问题,这可能会有所帮助stackoverflow.com/a/40501018/2336654