Skip to content

DOC: document that set_printoptions doesn't apply to numpy scalars #29409

@andyfaff

Description

@andyfaff

When one tries to print numpy scalars the printing does not respect np.set_printoptions.

import numpy as np
c = np.float64(0.128920820982908)
print(c)
with np.printoptions(precision=2):
    print(c)
    print(np.array([c]))

gives

0.128920820982908
0.128920820982908
[0.13]

This seems to be in contradiction to the docstring:

These options determine the way floating point numbers, arrays and other NumPy objects are displayed.

(emphasis is mine)

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy