import numpy as np A = np.array([[1.,0.],[0.,2.]]) invA = np.linalg.inv(A) # Aの逆行列 print( invA ) # 計算結果の表示