我在寻找与IDL操作符等价的Pythonnumpy
。
以下是# operator的作用:
Computes array elements by multiplying the columns of the first array by the rows of the second array. The second array must have the same number of columns as the first array has rows. The resulting array has the same number of columns as the first array and the same number of rows as the second array.
下面是我正在处理的numpy
数组:
A = [[ 0.9826128 0. 0.18566662]
[ 0. 1. 0. ]
[-0.18566662 0. 0.9826128 ]]
以及
^{pr2}$另外,numpy.dot(A,B)
会产生{
阅读IDL关于矩阵乘法定义的注释,似乎他们使用了与其他人相反的符号:
因此,可以通过相当奇怪的外观来实现:
numpy.dot(A.T, B.T).T
根据它们的示例值:
给予
^{pr2}$如果我是对的,你想要matrix multiplication。在
相关问题 更多 >
编程相关推荐