Skip to content

display.precision not honored for float-like values in notebook #25920

Open
@simonjayhawkins

Description

@simonjayhawkins

see also #17280, #25917 and #25919

Note: complex numbers are covered by #25514 and #25745 for to_string()

Code Sample, a copy-pastable example if possible

import pandas as pd
float_val = 0.55555555
complex_val = complex(float_val,float_val)
tuple_val= float_val,float_val
df = pd.DataFrame([float_val, complex_val, tuple_val])
pd.set_option('display.precision', 3)
df
0
0 0.556
1 (0.55555555+0.55555555j)
2 (0.55555555, 0.55555555)

Problem description

not all the float values are displayed with a precision of 3.

Expected Output

0
0 0.556
1 (0.556+0.556j)
2 (0.556, 0.556)

Output of pd.show_versions()

[paste the output of pd.show_versions() here below this line]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions