You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Resample.quantile(q=0.5, interpolation='nearest) and Resample.apply(lambda x: x.quantile(0.5, interpolation='nearest) produce different results. Behaviours were consistent when using other interpolation method, i.e. {‘linear’, ‘lower’, ‘higher’, ‘midpoint’} OR when q!=0.5
Expected Behavior
Actual result:
result from Resample.apply(lambda x: x.quantile(0.5, interpolation='nearest'): 50
result from Resample.quantile(q=0.5, interpolation='nearest'): 49
Expected result:
result from Resample.apply(lambda x: x.quantile(0.5, interpolation='nearest'): 50
result from Resample.quantile(q=0.5, interpolation='nearest'): 50
Installed Versions
INSTALLED VERSIONS
commit : e8093ba
python : 3.8.8.final.0
python-bits : 64
OS : Linux
OS-release : 5.15.0-41-generic
Version : #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
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
Issue Description
Resample.quantile(q=0.5, interpolation='nearest)
andResample.apply(lambda x: x.quantile(0.5, interpolation='nearest)
produce different results. Behaviours were consistent when using other interpolation method, i.e. {‘linear’, ‘lower’, ‘higher’, ‘midpoint’} OR whenq!=0.5
Expected Behavior
Actual result:
result from
Resample.apply(lambda x: x.quantile(0.5, interpolation='nearest')
: 50result from
Resample.quantile(q=0.5, interpolation='nearest')
: 49Expected result:
result from
Resample.apply(lambda x: x.quantile(0.5, interpolation='nearest')
: 50result from
Resample.quantile(q=0.5, interpolation='nearest')
: 50Installed Versions
INSTALLED VERSIONS
commit : e8093ba
python : 3.8.8.final.0
python-bits : 64
OS : Linux
OS-release : 5.15.0-41-generic
Version : #44~20.04.1-Ubuntu SMP Fri Jun 24 13:27:29 UTC 2022
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_GB.UTF-8
LOCALE : en_GB.UTF-8
pandas : 1.4.3
numpy : 1.22.3
pytz : 2021.3
dateutil : 2.8.2
setuptools : 52.0.0.post20210125
pip : 21.0.1
Cython : None
pytest : None
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : 1.4.3
lxml.etree : 4.6.3
html5lib : None
pymysql : 1.0.2
psycopg2 : None
jinja2 : 3.0.3
IPython : 8.0.1
pandas_datareader: 0.10.0
bs4 : 4.10.0
bottleneck : None
brotli :
fastparquet : None
fsspec : None
gcsfs : None
markupsafe : 2.0.1
matplotlib : 3.4.3
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : None
pyreadstat : None
pyxlsb : None
s3fs : None
scipy : 1.7.3
snappy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : None
xlrd : None
xlwt : None
zstandard : None
The text was updated successfully, but these errors were encountered: