diff options
author | Lev Maximov <axil.github@gmail.com> | 2022-06-14 23:58:32 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-06-14 10:58:32 -0600 |
commit | a5535dc6242b0decae1e65a3d4feb220fefedc49 (patch) | |
tree | 8e6f06fa4430567e9c4b81ff30dc9366ab3f267c /doc/source/reference | |
parent | 4d07c069422974c425390772c8e19f585a4f0bdf (diff) | |
download | numpy-a5535dc6242b0decae1e65a3d4feb220fefedc49.tar.gz |
MAINT: limit the number of decimals in Polynomial representation (#21654)
* limit the number of decimals in Polynomial representation
* tests pass
* parenthesize exponential notation in polynomials
* fixed a long line warning
* added polynomial printoptions tests
* polynomial printoptions typo fixed
* made switch to exp notation in polynomial display more natural
* added a test on switching polynomials to exp notation
* fixed linter errors/warnings
* support for nanstr and infstr printoptions in polynomials
* 10^8 threshold for switching to exp notation when displaying polynomials
* merged in PR #21696 fixing issue #21695
* made linter happy
* made some docstring tests pass
* fixed the docs
Co-authored-by: Lev Maximov <lev.maximov@gmail.com>
Diffstat (limited to 'doc/source/reference')
-rw-r--r-- | doc/source/reference/routines.polynomials.classes.rst | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/source/reference/routines.polynomials.classes.rst b/doc/source/reference/routines.polynomials.classes.rst index 05e1c5476..896e5fe83 100644 --- a/doc/source/reference/routines.polynomials.classes.rst +++ b/doc/source/reference/routines.polynomials.classes.rst @@ -69,7 +69,7 @@ Printing a polynomial yields the polynomial expression in a more familiar format:: >>> print(p) - 1.0 + 2.0·x¹ + 3.0·x² + 1.0 + 2.0·x + 3.0·x² Note that the string representation of polynomials uses Unicode characters by default (except on Windows) to express powers and subscripts. An ASCII-based @@ -79,12 +79,12 @@ format can be toggled at the package-level with the >>> np.polynomial.set_default_printstyle('ascii') >>> print(p) - 1.0 + 2.0 x**1 + 3.0 x**2 + 1.0 + 2.0 x + 3.0 x**2 or controlled for individual polynomial instances with string formatting:: >>> print(f"{p:unicode}") - 1.0 + 2.0·x¹ + 3.0·x² + 1.0 + 2.0·x + 3.0·x² We will deal with the domain and window when we get to fitting, for the moment we ignore them and run through the basic algebraic and arithmetic operations. |