【发布时间】:2015-04-02 18:11:22
【问题描述】:
我在 Python 中定义了几个数组,但在计算乘积时遇到问题。
import numpy as np
phi = np.array([[ 1., 1.],[ 0., 1.]])
P = np.array([[ 999., 0.],[ 0., 999.]])
np.dot(phi, P, phi.T)
我得到错误: ValueError: 输出数组不可接受(必须具有正确的类型、nr 维,并且是 C 数组)
但我不知道是什么问题,因为矩阵或数组的大小是 2 x 2
【问题讨论】:
-
你试过documentation吗?
-
是的,我还是有问题。
-
您的问题是-1(暂时)。您是尝试将三个矩阵相乘还是尝试将输出保存在转置矩阵上?
标签: python arrays dot-product