Python 为什么我的系统中安装的numpy没有matmul?

Python 为什么我的系统中安装的numpy没有matmul?,python,numpy,Python,Numpy,我在Ubuntu14.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. >>>

我在Ubuntu14.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'
>>> 
sudo-apt-get-install-python3-numpy
$python3
Python 3.4.3(默认值,2015年10月14日,20:28:29)
linux上的[GCC 4.8.4]
有关详细信息,请键入“帮助”、“版权”、“信用证”或“许可证”。
>>>将numpy作为np导入
>>>np.\u版本__
'1.8.2'
>>>a=[[1,0],[0,1]]
>>>b=[[4,1],[2,2]]
>>>np.matmul(a,b)
回溯(最近一次呼叫最后一次):
文件“”,第1行,在
AttributeError:“模块”对象没有属性“matmul”
>>> 
什么是我的错

谢谢。

np。matmul
已添加到
numpy 1.10.0
中,如下所示:

版本1.10.0中的新功能


使用np.linalg.matmul和np.linalg.dot语法时,我遇到了类似的错误,导致:AttributeError:module'numpy.linalg'没有属性'matmul'


我删除了“.linalg”,因此在我的情况下,np.dot和np.matmul将是正确的语法,但np.linalg.dot和np.linalg.matmul将产生错误。这让我想知道dot和matmul是否真的在linalg模块中,因为其他函数如np.linalg.inv和np.linalg.eig肯定需要np.linalg语法

什么是matmul?我也没有……谢谢。有没有办法在ubuntu 14.04中安装numpy 1.10.0?
einsum
同样强大
matmul
在通过
@
使用时最有用,这需要
python 3.5
。正如您在numpy文档中所看到的,[
matmul
dot
是顶级函数,而inv和eig被描述为
linalg.inv
linalg.eig