时间:2026-02-15 00:35:56
1、若矩阵使用python内置的列表表示,则可以使用内置函数map和zip完成行列互换:
2、若矩阵使用numpy包的ndarray表示,则可以使用numpy数组的T方法或transpose方法: