2019-11-15 行列の転置 数学 Python 行列の行と列を入れ替えることを、転置といいます。 Pythonで書くと、以下のようになります。 import numpy as np a = np.array([[1, 2, 3], [4, 5, 6]]) print(a.T)