diff options
author | Matthias Geier <Matthias.Geier@gmail.com> | 2016-04-27 15:06:42 +0200 |
---|---|---|
committer | Matthias Geier <Matthias.Geier@gmail.com> | 2016-04-29 10:46:43 +0200 |
commit | e33b286755401d81a96bb2d847b46c3096ac9903 (patch) | |
tree | 9e6779f0195da16db57480cb0688bffbeb775a29 /numpy/linalg/linalg.py | |
parent | 3c394f7f8d09f08aaa068e617f79d542c17fd771 (diff) | |
download | numpy-e33b286755401d81a96bb2d847b46c3096ac9903.tar.gz |
BUG: linalg.norm(): Don't convert object arrays to float
This fixes #7575 (Regression in linalg.norm() using dtype=object).
Diffstat (limited to 'numpy/linalg/linalg.py')
-rw-r--r-- | numpy/linalg/linalg.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/numpy/linalg/linalg.py b/numpy/linalg/linalg.py index 9d486d2a5..f4acd0ef3 100644 --- a/numpy/linalg/linalg.py +++ b/numpy/linalg/linalg.py @@ -23,7 +23,7 @@ from numpy.core import ( csingle, cdouble, inexact, complexfloating, newaxis, ravel, all, Inf, dot, add, multiply, sqrt, maximum, fastCopyAndTranspose, sum, isfinite, size, finfo, errstate, geterrobj, longdouble, rollaxis, amin, amax, product, abs, - broadcast, atleast_2d, intp, asanyarray, isscalar + broadcast, atleast_2d, intp, asanyarray, isscalar, object_ ) from numpy.lib import triu, asfarray from numpy.linalg import lapack_lite, _umath_linalg @@ -2112,7 +2112,7 @@ def norm(x, ord=None, axis=None, keepdims=False): """ x = asarray(x) - if not issubclass(x.dtype.type, inexact): + if not issubclass(x.dtype.type, (inexact, object_)): x = x.astype(float) # Immediately handle some default, simple, fast, and common cases. |