Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/arrays/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python中的变更顺序矩阵数组_Python_Arrays_Matrix - Fatal编程技术网

Python中的变更顺序矩阵数组

Python中的变更顺序矩阵数组,python,arrays,matrix,Python,Arrays,Matrix,晚安 我需要转换操作的结果,我不知道如何: C = np.matmul(A, B) print(C) 我得到: [[1 3 22 6] [5 14 5 3] [44 31 24 33]] 但我需要: [[1 5 44 3] [14 31 22 5] [24 6 3 33]] 如何将第一个结果转换为第二个结果 感谢转换矩阵,重塑为12元素向量(或1x12矩阵),然后重塑为最终形式。np.matmul向后倍数 按照您的想象:试试C=np.matmul(B,A)。如果我们没有矩阵A或B,那就更难了

晚安

我需要转换操作的结果,我不知道如何:

C = np.matmul(A, B)
print(C)
我得到:

[[1 3 22 6]

[5 14 5 3]

[44 31 24 33]]

但我需要:

[[1 5 44 3]

[14 31 22 5]

[24 6 3 33]]

如何将第一个结果转换为第二个结果


感谢

转换矩阵,重塑为12元素向量(或1x12矩阵),然后重塑为最终形式。

np.matmul
向后倍数
按照您的想象:试试
C=np.matmul(B,A)
。如果我们没有矩阵
A
B
,那就更难了

它起作用了!谢谢您!!