summaryrefslogtreecommitdiff
path: root/numpy/linalg/linalg.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/linalg/linalg.py')
-rw-r--r--numpy/linalg/linalg.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py
index a557af875..ea4585dfa 100644
--- a/numpy/linalg/linalg.py
+++ b/numpy/linalg/linalg.py
@@ -1147,10 +1147,10 @@ def lstsq(a, b, rcond=-1):
"""
import math
- a = _makearray(a)
+ a, _ = _makearray(a)
b, wrap = _makearray(b)
- one_eq = len(b.shape) == 1
- if one_eq:
+ is_1d = len(b.shape) == 1
+ if is_1d:
b = b[:, newaxis]
_assertRank2(a, b)
m = a.shape[0]
@@ -1199,7 +1199,7 @@ def lstsq(a, b, rcond=-1):
if results['info'] > 0:
raise LinAlgError, 'SVD did not converge in Linear Least Squares'
resids = array([], t)
- if one_eq:
+ if is_1d:
x = array(ravel(bstar)[:n], dtype=result_t, copy=True)
if results['rank'] == n and m > n:
resids = array([sum((ravel(bstar)[n:])**2)], dtype=result_t)