summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2020-12-30 17:35:20 -0700
committerGitHub <noreply@github.com>2020-12-30 17:35:20 -0700
commit31647f1b3e56c2f2a471cd2c3a583311534173f8 (patch)
tree8f76fea862a19920e062889c23cc1828b83a9ab7 /numpy
parent1b8b46b3f2f68f5be8e52e798eb91c2ac5952745 (diff)
parent860c8b82939d1535351f7b651c284a55efe21b10 (diff)
downloadnumpy-31647f1b3e56c2f2a471cd2c3a583311534173f8.tar.gz
Merge pull request #18062 from krnilo/add-lstsq-details
DOC: add missing details to linalg.lstsq docstring
Diffstat (limited to 'numpy')
-rw-r--r--numpy/linalg/linalg.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py
index 7775e4c32..46fb2502e 100644
--- a/numpy/linalg/linalg.py
+++ b/numpy/linalg/linalg.py
@@ -2171,13 +2171,14 @@ def lstsq(a, b, rcond="warn"):
r"""
Return the least-squares solution to a linear matrix equation.
- Computes the vector x that approximatively solves the equation
+ 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. Else, `x` minimizes the
- Euclidean 2-norm :math:`|| b - a x ||`.
+ Euclidean 2-norm :math:`||b - ax||`. If there are multiple minimizing
+ solutions, the one with the smallest 2-norm :math:`||x||` is returned.
Parameters
----------