import numpy as np a = np.mat([[1,3], [2,7]]) #要用matrix, 而不是array a.I ==> matrix([[ 7., -3.], [-2., 1.]]) 矩阵求逆