I was posting a question on similar subject, and encountered another more important question.
When I apply SVD to a matrix 'A' (code below) the output I get is the expected 2-D eigenvector matrices ('U' and 'V') and an unexpected 1-D singular value array 'S'.
U,S,V=np.linalg.svd(A)
For context: The reason for it being unexpected is that Singular Value Decomposition should result in the product of three matrices. The middle matrix (in this case 1-D array) should be a diagonal matrix, holding non-negative singular values in decreasing order of magnitude.
Why does Python 'transform' the matrix into an array? Is there a way around it?
Thanks!