Skip to content

display.precision not honored for float valued index names #25917

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
simonjayhawkins opened this issue Mar 29, 2019 · 0 comments
Open

display.precision not honored for float valued index names #25917

simonjayhawkins opened this issue Mar 29, 2019 · 0 comments
Labels
Bug Output-Formatting __repr__ of pandas objects, to_string

Comments

@simonjayhawkins
Copy link
Member

see also #17280

Code Sample, a copy-pastable example if possible

import pandas as pd
float_val = 0.55555555
index=pd.MultiIndex.from_tuples([(float_val,float_val)], names=[float_val,float_val])
df = pd.DataFrame([float_val], index=index, columns=index)
pd.set_option('display.precision', 3)
df
0.55555555 0.556
0.55555555 0.556
0.55555555 0.55555555
0.556 0.556 0.556

Problem description

the float valued index names are not displayed with a precision of 3.

Expected Output

0.556 0.556
0.556 0.556
0.556 0.556
0.556 0.556 0.556

Output of pd.show_versions()

INSTALLED VERSIONS

commit: None
python: 3.7.2.final.0
python-bits: 64
OS: Windows
OS-release: 10
machine: AMD64
processor: Intel64 Family 6 Model 58 Stepping 9, GenuineIntel
byteorder: little
LC_ALL: None
LANG: None
LOCALE: None.None

pandas: 0.25.0.dev0+332.g96a128eaa
pytest: 4.3.0
pip: 19.0.3
setuptools: 40.6.3
Cython: 0.29.5
numpy: 1.16.2
scipy: 1.2.1
pyarrow: 0.11.1
xarray: 0.11.3
IPython: 7.3.0
sphinx: 1.8.4
patsy: 0.5.1
dateutil: 2.8.0
pytz: 2018.9
blosc: None
bottleneck: 1.2.1
tables: 3.4.4
numexpr: 2.6.9
feather: None
matplotlib: 3.0.2
openpyxl: 2.6.0
xlrd: 1.2.0
xlwt: 1.3.0
xlsxwriter: 1.1.5
lxml.etree: 4.3.1
bs4: 4.7.1
html5lib: 1.0.1
sqlalchemy: 1.2.18
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: 0.2.0
fastparquet: 0.2.1
pandas_gbq: None
pandas_datareader: None
gcsfs: None

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

No branches or pull requests

3 participants