We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Consider the following example:
import pandas as pd s = pd.Series([840.0, 4200.0]) pd.set_option('precision', 0) print(s) pd.set_option('precision',2) print(s)
The first print produces 84, 420, while the second one produces correctly 840.0 and 4200.0.
If I understand docs correctly, the precision option should affect only the number of digits after the decimal point, not the digits before it.
First print shows 840 and 4200 (or 840.0, 4200.0).
pd.show_versions()
commit: None python: 3.6.3.final.0 python-bits: 64 OS: Linux OS-release: 4.14.8-300.fc27.x86_64 machine: x86_64 processor: x86_64 byteorder: little LC_ALL: None LANG: pl_PL.UTF-8 LOCALE: pl_PL.UTF-8
pandas: 0.22.0 pytest: 3.3.1 pip: 9.0.1 setuptools: 36.5.0 Cython: None numpy: 1.14.2 scipy: 0.19.1 pyarrow: None xarray: None IPython: 6.2.1 sphinx: None patsy: 0.4.1 dateutil: 2.7.0 pytz: 2018.3 blosc: None bottleneck: None tables: None numexpr: None feather: None matplotlib: 2.1.2 openpyxl: 2.4.9 xlrd: 1.0.0 xlwt: None xlsxwriter: 1.0.2 lxml: None bs4: None html5lib: 1.0.1 sqlalchemy: None pymysql: None psycopg2: None jinja2: 2.10 s3fs: None fastparquet: None pandas_gbq: None pandas_datareader: None
The text was updated successfully, but these errors were encountered:
I think your bug is a result of the code in _trim_zeros linked below - care to take a look and try a PR?
_trim_zeros
pandas/pandas/io/formats/format.py
Line 1391 in 2d491c3
Sorry, something went wrong.
@WillAyd sure, I'll look into it.
Fix strange behavior when precision display option is zero (#20359) (#…
f0a7d18
…35212)
Successfully merging a pull request may close this issue.
Consider the following example:
The first print produces 84, 420, while the second one produces correctly 840.0 and 4200.0.
Problem description
If I understand docs correctly, the precision option should affect only the number of digits after the decimal point, not the digits before it.
Expected Output
First print shows 840 and 4200 (or 840.0, 4200.0).
Output of
pd.show_versions()
INSTALLED VERSIONS
commit: None
python: 3.6.3.final.0
python-bits: 64
OS: Linux
OS-release: 4.14.8-300.fc27.x86_64
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: pl_PL.UTF-8
LOCALE: pl_PL.UTF-8
pandas: 0.22.0
pytest: 3.3.1
pip: 9.0.1
setuptools: 36.5.0
Cython: None
numpy: 1.14.2
scipy: 0.19.1
pyarrow: None
xarray: None
IPython: 6.2.1
sphinx: None
patsy: 0.4.1
dateutil: 2.7.0
pytz: 2018.3
blosc: None
bottleneck: None
tables: None
numexpr: None
feather: None
matplotlib: 2.1.2
openpyxl: 2.4.9
xlrd: 1.0.0
xlwt: None
xlsxwriter: 1.0.2
lxml: None
bs4: None
html5lib: 1.0.1
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: 2.10
s3fs: None
fastparquet: None
pandas_gbq: None
pandas_datareader: None
The text was updated successfully, but these errors were encountered: