diff options
author | Charles Harris <charlesr.harris@gmail.com> | 2013-01-24 09:13:40 -0700 |
---|---|---|
committer | Charles Harris <charlesr.harris@gmail.com> | 2013-01-24 09:22:42 -0700 |
commit | 7c1435c11d8bc0d1a3a380bc541a46f75749dc52 (patch) | |
tree | 5a02b21a6ff9bc8303981cb13d79f585a1085732 /numpy/polynomial/polynomial.py | |
parent | ccbbfd5fd4c0377672aff5701e3624254b3a3138 (diff) | |
download | numpy-7c1435c11d8bc0d1a3a380bc541a46f75749dc52.tar.gz |
MAINT: Use a better method to detect complex arrays.
Instead of
if lhs.dtype.char in np.typecodes['Complex']:
use
if issubclass(lhs.dtype.type, np.complexfloating):
Diffstat (limited to 'numpy/polynomial/polynomial.py')
-rw-r--r-- | numpy/polynomial/polynomial.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py index 4e24e9c1f..8d7251b19 100644 --- a/numpy/polynomial/polynomial.py +++ b/numpy/polynomial/polynomial.py @@ -1366,7 +1366,7 @@ def polyfit(x, y, deg, rcond=None, full=False, w=None): rcond = len(x)*np.finfo(x.dtype).eps # Determine the norms of the design matrix columns. - if lhs.dtype.char in np.typecodes['Complex']: + if issubclass(lhs.dtype.type, np.complexfloating): scl = np.sqrt((np.square(lhs.real) + np.square(lhs.imag)).sum(1)) else: scl = np.sqrt(np.square(lhs).sum(1)) |