时间:2024-10-13 19:01:29
1、若矩阵使用python内置的列表表示,则可以使用内置函数map和zip完成行列互换:
2、若矩阵使用numpy包的ndarray表示,则可以使用numpy数组的T方法或transpose方法: