summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--numpy/polynomial/chebyshev.py2
-rw-r--r--numpy/polynomial/hermite.py2
-rw-r--r--numpy/polynomial/hermite_e.py2
-rw-r--r--numpy/polynomial/laguerre.py2
-rw-r--r--numpy/polynomial/legendre.py2
-rw-r--r--numpy/polynomial/polynomial.py2
6 files changed, 6 insertions, 6 deletions
diff --git a/numpy/polynomial/chebyshev.py b/numpy/polynomial/chebyshev.py
index 4d87c8470..afeafcb68 100644
--- a/numpy/polynomial/chebyshev.py
+++ b/numpy/polynomial/chebyshev.py
@@ -1743,7 +1743,7 @@ def chebfit(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))
diff --git a/numpy/polynomial/hermite.py b/numpy/polynomial/hermite.py
index 66940a28e..2beb848ae 100644
--- a/numpy/polynomial/hermite.py
+++ b/numpy/polynomial/hermite.py
@@ -1520,7 +1520,7 @@ def hermfit(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))
diff --git a/numpy/polynomial/hermite_e.py b/numpy/polynomial/hermite_e.py
index 9ff7c06d2..c183a5a86 100644
--- a/numpy/polynomial/hermite_e.py
+++ b/numpy/polynomial/hermite_e.py
@@ -1516,7 +1516,7 @@ def hermefit(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))
diff --git a/numpy/polynomial/laguerre.py b/numpy/polynomial/laguerre.py
index 6e035ebd2..f0c1268bf 100644
--- a/numpy/polynomial/laguerre.py
+++ b/numpy/polynomial/laguerre.py
@@ -1519,7 +1519,7 @@ def lagfit(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))
diff --git a/numpy/polynomial/legendre.py b/numpy/polynomial/legendre.py
index e909ad9b1..0efd13ffa 100644
--- a/numpy/polynomial/legendre.py
+++ b/numpy/polynomial/legendre.py
@@ -1544,7 +1544,7 @@ def legfit(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))
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))