BUG: describe started rounding reported percentile 99.999% to 100% · Issue #55765 · pandas-dev/pandas (original) (raw)
Pandas version checks
- I have checked that this issue has not already been reported.
- I have confirmed this bug exists on the latest version of pandas.
- I have confirmed this bug exists on the main branch of pandas.
Reproducible Example
import pandas as pd
D = pd.DataFrame({"a":[23, 51]}) D.a.describe([0.9, 0.99, 0.999, 0.9999, 0.99999])
Issue Description
In the pandas 1.x version I was using (don't know exactly which after I bumped) describe()
used to compute the requested percentiles. However, I just bumped to 2.1.2 and now my percentile 99.999% is reported as percentile 100%, even though it is not, by the following example:
Observed issues:
- Row 99.999% is now reported as 100%; <-- This is the one that affects me the most
- Clearly requesting percentiles 99.999% and 100% is still different, by looking at the outputs of the two 100% rows;
- max doesn't match 100%.
Expected Behavior
The percentile with 5 9's should still report as percentile 99.999% on the output table.
That problem affects me the most, however, the other 2 could also hypothetically be considered unexpected.
Installed Versions
INSTALLED VERSIONS
commit : a60ad39
python : 3.11.5.final.0
python-bits : 64
OS : Linux
OS-release : 5.15.0-87-generic
Version : #97~20.04.1-Ubuntu SMP Thu Oct 5 08:25:28 UTC 2023
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 2.1.2
numpy : 1.26.1
pytz : 2023.3.post1
dateutil : 2.8.2
setuptools : 68.0.0
pip : 23.3
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.2
IPython : 8.16.1
pandas_datareader : None
bs4 : 4.12.2
bottleneck : None
dataframe-api-compat: None
fastparquet : None
fsspec : None
gcsfs : None
matplotlib : 3.8.0
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
zstandard : None
tzdata : 2023.3
qtpy : None
pyqt5 : None