我已经在ubuntu 14.04中安装了numpy,但是如示例代码所示,使用matmul会导致错误.
sudo apt-get install python3-numpy
$ python3
Python 3.4.3 (default, Oct 14 2015, 20:28:29)
[GCC 4.8.4] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np
>>> np.__version__
'1.8.2'
>>> a = [[1, 0], [0, 1]]
>>> b = [[4, 1], [2, 2]]
>>> np.matmul(a, b)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'matmul'
>>>
Run Code Online (Sandbox Code Playgroud)
我的错是什么?
谢谢.
| 归档时间: |
|
| 查看次数: |
4806 次 |
| 最近记录: |