summaryrefslogtreecommitdiff
path: root/numpy/polynomial/polynomial.py
diff options
context:
space:
mode:
authorMatti Picus <matti.picus@gmail.com>2020-06-04 08:38:30 +0300
committerGitHub <noreply@github.com>2020-06-04 08:38:30 +0300
commit821a18e55916d0d40227c58ea75f589ea3d9f078 (patch)
treebfc71a190b2488d5a71d07740b8aeb3f07e18bc2 /numpy/polynomial/polynomial.py
parent924cbe4dadcabd337a6d8b0ef6efa3091a3ed5fc (diff)
parent4dc9ff62a78004d6debd0953d70cd39864b9d6c3 (diff)
downloadnumpy-821a18e55916d0d40227c58ea75f589ea3d9f078.tar.gz
Merge pull request #15666 from rossbar/enh/poly_str
ENH: Improved `__str__` for polynomials
Diffstat (limited to 'numpy/polynomial/polynomial.py')
-rw-r--r--numpy/polynomial/polynomial.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/numpy/polynomial/polynomial.py b/numpy/polynomial/polynomial.py
index 2fb032db3..97f1e7dc0 100644
--- a/numpy/polynomial/polynomial.py
+++ b/numpy/polynomial/polynomial.py
@@ -1495,6 +1495,14 @@ class Polynomial(ABCPolyBase):
window = np.array(polydomain)
basis_name = None
+ @classmethod
+ def _str_term_unicode(cls, i, arg_str):
+ return f"ยท{arg_str}{i.translate(cls._superscript_mapping)}"
+
+ @staticmethod
+ def _str_term_ascii(i, arg_str):
+ return f" {arg_str}**{i}"
+
@staticmethod
def _repr_latex_term(i, arg_str, needs_parens):
if needs_parens: