summaryrefslogtreecommitdiff
path: root/numpy/polynomial/_polybase.py
diff options
context:
space:
mode:
Diffstat (limited to 'numpy/polynomial/_polybase.py')
-rw-r--r--numpy/polynomial/_polybase.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/numpy/polynomial/_polybase.py b/numpy/polynomial/_polybase.py
index 7616b95c7..30887b670 100644
--- a/numpy/polynomial/_polybase.py
+++ b/numpy/polynomial/_polybase.py
@@ -347,14 +347,14 @@ class ABCPolyBase(abc.ABC):
out += " "
power = str(i + 1)
# Polynomial coefficient
+ # The coefficient array can be an object array with elements that
+ # will raise a TypeError with >= 0 (e.g. strings or Python
+ # complex). In this case, represent the coeficient as-is.
try:
if coef >= 0:
next_term = f"+ {coef}"
else:
next_term = f"- {-coef}"
- # The coefficient array can be an object array with elements that
- # will raise a TypeError with >= 0 (e.g. strings or Python
- # complex). In this case, represent the coeficient as-is.
except TypeError:
next_term = f"+ {coef}"
# Polynomial term