【发布时间】:2013-10-09 00:44:23
【问题描述】:
如何使用 python 和 scipy 获取泊松随机变量?哇..我安装了 scipy 并且根据文档我得到没有名为 scipy.stats 的模块?我在 ubuntu 12.04 上。所以......去图
http://docs.scipy.org/doc/scipy/reference/generated/scipy.stats.poisson.html
ubuntu@ubuntu:~/Downloads$ sudo apt-get install python-scipy
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-scipy is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 482 not upgraded.
ubuntu@ubuntu:~/Downloads$ python
Python 2.7.3 (default, Apr 10 2013, 06:20:15)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from scipy.stats import poisson
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named scipy.stats
【问题讨论】:
-
是 python 3 或 2.7 的 python-scipy 版本?你可以只导入 scipy 吗?
-
你能
import scipy吗?它的版本是什么? -
尝试检查使用
python-scipy安装的文件,我认为在ubuntu 上是dpkg -L python-scipy -
/usr/lib/python2.7/dist-packages/scipy-0.9.0.egg-info