8000 np.set_printoptions doesn't affect floats · Issue #11048 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content
8000
np.set_printoptions doesn't affect floats #11048
Open
@louisabraham

Description

@louisabraham
>>> import numpy as np
>>> '%s' % np.array(1/3)
'0.3333333333333333'
>>> '%s' % np.array([1/3])
'[0.33333333]'
>>> np.set_printoptions(formatter={"float_kind": lambda x: "%.1f" % x})
>>> '%s' % np.array(1/3)
'0.3333333333333333'
>>> '%s' % np.array([1/3])
'[0.3]'

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

      0