transepose 矩阵的转置


转置有两种用法 transepose  和x.T


x = np.arange(9).reshape((3,3))


x

Out[314]: 
array([[0, 1, 2],
       [3, 4, 5],
       [6, 7, 8]])


np.transpose(x)


Out[315]: 
array([[0, 3, 6],
       [1, 4, 7],

       [2, 5, 8]])


print(x.T)
[[0 3 6]
 [1 4 7]
 [2 5 8]


posted @ 2022-08-19 23:00  luoganttcc  阅读(13)  评论(0编辑  收藏  举报