【发布时间】:2016-05-01 21:55:02
【问题描述】:
我有一个 3x10 矩阵(以 numpy 数组的形式)并且想将它乘以一个 3x3 变换矩阵。我不认为 np.dot 正在做完整的矩阵乘法。有没有办法用数组做这种乘法?
transf = np.array([ [0.1, -0.4, 0],[0.9, 0.75, -0.1],[0.5, 0.75, -0.9] ])
one = [0,1,2,3,4,5,6,8,9]
two = [1,2,3,4,5,6,8,9,10]
three = [2,3,4,5,6,8,9,10,11]
data = np.array([ one, two, three ])
new_data = np.dot(transf,data)
有没有做整个矩阵乘法的点函数,而不仅仅是"For N dimensions it is a sum product over the last axis of a and the second-to-last of b"
【问题讨论】:
-
documentation 声明对于二维数组,
np.dot等价于矩阵乘法...
标签: python arrays numpy matrix