Code Sample, a copy-pastable example if possible
# Your code here
>>> loc1series4 = pd.Series([6,8,10,12,14,9,11,7,13,11])
Problem description
loc1series4.quantile(0.25) 8.25 loc1series4.quantile(0.75) 11.75 Wrong result. [this should explain why the current behaviour is a problem and why the expected output is a better solution.]
Expected Output
loc1series4.quantile(0.25) 7.75 loc1series4.quantile(0.75) 12.25
Output of pd.show_versions()
# Paste the output here pd.show_versions() here
>>> pd.show_versions()
INSTALLED VERSIONS
------------------
commit: None
python: 3.5.2.final.0
python-bits: 64
OS: Darwin
OS-release: 16.3.0
machine: x86_64
processor: i386
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8
LOCALE: en_GB.UTF-8
pandas: 0.19.1
nose: None
pip: 9.0.1
setuptools: 27.2.0
Cython: None
numpy: 1.11.2
scipy: None
statsmodels: None
xarray: None
IPython: None
sphinx: None
patsy: None
dateutil: 2.6.0
pytz: 2016.10
blosc: None
bottleneck: None
tables: None
numexpr: None
matplotlib: 1.5.3
openpyxl: None
xlrd: 1.0.0
xlwt: None
xlsxwriter: None
lxml: None
bs4: None
html5lib: None
httplib2: None
apiclient: None
sqlalchemy: None
pymysql: None
psycopg2: None
jinja2: None
boto: None
pandas_datareader: None
Comment From: dileepponna
This is using 'interpolation=linear' scenario.
Comment From: Dr-Irv
The docs say this is like numpy.percentile
. If you look at those docs at https://docs.scipy.org/doc/numpy-dev/reference/generated/numpy.percentile.html, you will see that the quantile is defined as being between the minimum and the maximum, i.e., the minimum=0, the maximum=1.0. So the result is correct.
Comment From: jreback
yep, this is outlined in the docs.