diff options
author | Pierre de Buyl <pdebuyl@pdebuyl.be> | 2020-04-10 21:24:07 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-04-10 14:24:07 -0500 |
commit | 51d1a99a84f5e2183b79dcc04713ffd90cb0caf2 (patch) | |
tree | 0cfb697ec4b0f57df90b3b4eba0cb1975807bd93 | |
parent | 9005d7df9b644b3b3de55118b7f7ffa026e4284b (diff) | |
download | numpy-51d1a99a84f5e2183b79dcc04713ffd90cb0caf2.tar.gz |
DOC: Improve docstring for numpy.linalg.lstsq (gh-15920)
Start the docstring with """Computes the vector x that approximatively
solves the equation :math:`a x = b`.""" instead of """Solves the
equation :math:`a x = b`""".
Co-Authored-By: Ross Barnowski <rossbar@berkeley.edu>
Closes gh-15874
-rw-r--r-- | numpy/linalg/linalg.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py index eb03932e1..eac6267c6 100644 --- a/numpy/linalg/linalg.py +++ b/numpy/linalg/linalg.py @@ -2172,13 +2172,13 @@ def lstsq(a, b, rcond="warn"): r""" Return the least-squares solution to a linear matrix equation. - Solves the equation :math:`a x = b` by computing a vector `x` that - minimizes the squared Euclidean 2-norm :math:`\| b - a x \|^2_2`. - The equation may be under-, well-, or over-determined (i.e., the - number of linearly independent rows of `a` can be less than, equal - to, or greater than its number of linearly independent columns). + Computes the vector x that approximatively solves the equation + ``a @ x = b``. The equation may be under-, well-, or over-determined + (i.e., the number of linearly independent rows of `a` can be less than, + equal to, or greater than its number of linearly independent columns). If `a` is square and of full rank, then `x` (but for round-off error) - is the "exact" solution of the equation. + is the "exact" solution of the equation. Else, `x` minimizes the + Euclidean 2-norm :math:`|| b - a x ||`. Parameters ---------- |