Computational Physics, Python, Linear Algebra, Math, Mathematics.
non square matrix , calculate its singular value decomposition and its pseudo-inverse. A = np.array([[7, 2], [3, 4], [5, 3]]) U, D, V = np.linalg.svd(A) D_plus = np.zeros((A.shape[0], A.shape[1])).T D_plus[:D.shape[0], :D.shape[0]] = np.linalg.inv(np.diag(D)) A_plus = V.T.dot(D_plus).dot(U.T)