numpy 1.22.4 Pypi GitHub Homepage
Other Docs
NotesParameters
set_default_printstyle(style)

Values for style must be valid inputs to __format__ , i.e. 'ascii' or 'unicode'.

Notes

The default format depends on the platform: 'unicode' is used on Unix-based systems and 'ascii' on Windows. This determination is based on default font support for the unicode superscript and subscript ranges.

Parameters

style : str

Format string for default printing style. Must be either 'ascii' or 'unicode'.

Set the default format for the string representation of polynomials.

Examples

>>> p = np.polynomial.Polynomial([1, 2, 3])
... c = np.polynomial.Chebyshev([1, 2, 3])
... np.polynomial.set_default_printstyle('unicode')
... print(p) 1.0 + 2.0·x¹ + 3.0·x²
>>> print(c)
1.0 + 2.0·T₁(x) + 3.0·T₂(x)
>>> np.polynomial.set_default_printstyle('ascii')
... print(p) 1.0 + 2.0 x**1 + 3.0 x**2
>>> print(c)
1.0 + 2.0 T_1(x) + 3.0 T_2(x)
>>> # Formatting supersedes all class/package-level defaults
... print(f"{p:unicode}") 1.0 + 2.0·x¹ + 3.0·x²
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/polynomial/__init__.py#134
type: <class 'function'>
Commit: