Singular value decomposition: Difference between revisions

Add Python
(Add Python)
Line 77:
-0.707107 0.707107
</syntaxhighlight>
 
=={{header|Python}}==
This implementation uses "numpy" library.
<syntaxhighlight lang=python>
from numpy import *
A = matrix([[3, 0], [4, 5]])
U, Sigma, VT = linalg.svd(A)
print(U)
print(Sigma)
print(VT)
</syntaxhighlight>
{{output}}
<pre>
[[-0.31622777 -0.9486833 ]
[-0.9486833 0.31622777]]
[6.70820393 2.23606798]
[[-0.70710678 -0.70710678]
[-0.70710678 0.70710678]]
</pre>
43

edits