Skip to content

ENH: Make Polynomial adhere to set_printoptions Β #21653

@axil

Description

@axil

Proposed new feature or change:

Currently Polynomial displays as many digits as it can:

x = np.arange(10)
y = 5 * x + 1 + np.random.randn(10)
f = np.polynomial.Polynomial.fit(x, y, 1).convert(); f

π‘₯↦0.622720266227418+5.0153841318332235π‘₯

It'd be better if it only displayed the number of digits (or less if it can be uniquely represented) configured with np.set_printoptions:

π‘₯↦0.62272026+5.01538413π‘₯

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions