[Numpy-discussion] SVD problem - matrices are not aligned

Daniel Wagner daniel.wagner.ml@googlemail....
Sat Oct 23 20:00:01 CDT 2010


Hi,

I'm a new subscriber of this list. I hope to directly start with a question is ok...

My question or problem:
I've a matrix A which is calculated from the data b. The shapes of these matrices are:
>>>A.shape
(954, 9)
>>>b.shape
(954,)

I calculate the SVD of A:
>>> U, w, V = numpy.linalg.svd(A, full_matrices="True")
>>>U.shape
(954, 954)
>>>W.diag(w)
>>>W.shape
(9,9)
>>>V.shape
(9,9)

If I'm doing the check of the SVD results using:
>>>numpy.allclose(A, numpy.dot(U, numpy.dot(W, V)))
I get this error:
"ValueError: matrices are not aligned"

I'just don't get where the error does come from. There seems to be a general problem with my data or how I'm using the svd function. I hope anybody has an idea what I'm doing wrong or where my problem comes from. I really appreciate any suggestions!

Many thanks!
Greetings,
Daniel Wagner


More information about the NumPy-Discussion mailing list