1、引入 numpy库import numpy
2、测试矩阵编写matrix = [[1,2,3], [4,5,6], [7,8,9]]
3、转化为矩阵mat=numpy.matrix(matrix)
4、使用 T方法 转置 即可实现行列转换