Skip to content

The method to undo numpy set_printoptions #8344

Closed
@kyruzic

Description

@kyruzic

In order to undo what ever print options I have set I need to call a function with a massive number of arguments. Why isn't there an argument like default=False and then if I call it with default=True I get back to the original print options. This doesn't have much of an impact in regular programs but it does have a huge impact in jupyter notebooks! A huge amount of computational physics teaching is shifting to these and it is so frustrating to have to have such an ugly line of code for absolutely no reason when it could be fixed in the simplest way.

This is taken directly from numpys documentation
np.set_printoptions(edgeitems=3,infstr='inf',
... linewidth=75, nanstr='nan', precision=8,
... suppress=False, threshold=1000, formatter=None)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions