summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-09-20 22:45:26 +0300
committerGitHub <noreply@github.com>2020-09-20 22:45:26 +0300
commit70f4309a155808d3a60a9a71db2d9482c1ec3ad7 (patch)
tree54cf50782238013653947f15727f77235d57d464
parent3b294521a7394c2195e6b2980555c6b27258bac9 (diff)
parenta9b4bff3613a0081703f46523d37f81982170a8c (diff)
downloadnumpy-70f4309a155808d3a60a9a71db2d9482c1ec3ad7.tar.gz
Merge pull request #17354 from sappelhoff/lstsq-docstr
DOC: clarify residuals return param
-rw-r--r--numpy/linalg/linalg.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py
index 92f93d671..b6d860dfa 100644
--- a/numpy/linalg/linalg.py
+++ b/numpy/linalg/linalg.py
@@ -2206,8 +2206,8 @@ def lstsq(a, b, rcond="warn"):
Least-squares solution. If `b` is two-dimensional,
the solutions are in the `K` columns of `x`.
residuals : {(1,), (K,), (0,)} ndarray
- Sums of residuals; squared Euclidean 2-norm for each column in
- ``b - a*x``.
+ Sums of squared residuals: Squared Euclidean 2-norm for each column in
+ ``b - a @ x``.
If the rank of `a` is < N or M <= N, this is an empty array.
If `b` is 1-dimensional, this is a (1,) shape array.
Otherwise the shape is (K,).
@@ -2558,7 +2558,7 @@ def norm(x, ord=None, axis=None, keepdims=False):
# special case for speedup
s = (x.conj() * x).real
return sqrt(add.reduce(s, axis=axis, keepdims=keepdims))
- # None of the str-type keywords for ord ('fro', 'nuc')
+ # None of the str-type keywords for ord ('fro', 'nuc')
# are valid for vectors
elif isinstance(ord, str):
raise ValueError(f"Invalid norm order '{ord}' for vectors")