📜  转置矩阵 numpy - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:02.108000             🧑  作者: Mango

代码示例4
>>> import numpy as np
>>> M = np.array([[1,2,3],[4,5,6],[7,8,9]])
>>> M
array([[1, 2, 3],
       [4, 5, 6],
       [7, 8, 9]])
>>> M.T
array([[1, 4, 7],
       [2, 5, 8],
       [3, 6, 9]])