1
1.数组的转置
import numpy as np
M = [[1,2,3],[4,5,6],[7,8,9]]
l = np.array(M)
'''[[1,2,3]
[4,5,6]
[7,8,9]
]
'''
M.shape #(3,3) 3行3列
M.T ##转置
'''[[1,4,7]
[2,5,8]
[3,6,9]]
'''
1
1.数组的转置
import numpy as np
M = [[1,2,3],[4,5,6],[7,8,9]]
l = np.array(M)
'''[[1,2,3]
[4,5,6]
[7,8,9]
]
'''
M.shape #(3,3) 3行3列
M.T ##转置
'''[[1,4,7]
[2,5,8]
[3,6,9]]
'''