Skip to content

Commit 11b9ee2

Browse files
ev-bralexbrc
authored andcommitted
DOC: document how svdvals handles empty input
1 parent 77a4b6a commit 11b9ee2

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

scipy/linalg/decomp_svd.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,17 @@ def svdvals(a, overwrite_a=False, check_finite=True):
140140
LinAlgError
141141
If SVD computation does not converge.
142142
143+
Notes
144+
-----
145+
``svdvals(a)`` only differs from ``svd(a, compute_uv=False)`` by its
146+
handling of the edge case of empty ``a``, where it returns an
147+
empty sequence:
148+
149+
>>> a = np.empty((0, 2))
150+
>>> from scipy.linalg import svdvals
151+
>>> svdvals(a)
152+
array([], dtype=float64)
153+
143154
See also
144155
--------
145156
svd : Compute the full singular value decomposition of a matrix.

0 commit comments

Comments
 (0)