-
-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
API: quantile function over columns transposes dataframe #35363
Comments
Thanks @tomvansteijn for the report. This is not a bug. This is the expected behaviour so closing. lmk if I misunderstood something and i'll reopen. from https://pandas.pydata.org/pandas-docs/dev/reference/api/pandas.DataFrame.quantile.html
|
Thanks @simonjayhawkins for the clarification. You are right this is not a bug. In usage I think it would make more sense when the columns are q and the index is preserved when computing quantiles over the columns. Currently a transpose is needed to undo the implicit transpose in Is it worthwile to label this an enhancement and reopen? |
sure |
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
Code snippet
Problem description
Using
DataFrame.quantile
over axis=1 with multiple values for q transposes the dataframe. I would expect the quantiles to appear over the specified axis, so along the columns axis when axis = 1, and along rows when axis = 0. Ofcourse, an easy fix is a call toDataFrame.transpose
. Ideally this should not be necessary in my opinion.Expected Output
Quantile values over the specified axis without transposing the dataframe.
Output of
pd.show_versions()
C:\Anaconda64\lib\site-packages\setuptools\distutils_patch.py:26: UserWarning: Distutils was imported before Setuptools. This usage is discouraged and may exhibit undesirable behaviors or errors. Please use Setuptools' objects directly or at least import Setuptools first.
"Distutils was imported before Setuptools. This usage is discouraged "
INSTALLED VERSIONS
commit : None
python : 3.7.6.final.0
python-bits : 64
OS : Windows
OS-release : 10
machine : AMD64
processor : Intel64 Family 6 Model 158 Stepping 10, GenuineIntel
byteorder : little
LC_ALL : None
LANG : nl_NL.UTF-8
LOCALE : None.None
pandas : 1.0.5
numpy : 1.18.5
pytz : 2020.1
dateutil : 2.8.1
pip : 20.1.1
setuptools : 49.2.0.post20200712
Cython : 0.29.21
pytest : 5.4.3
hypothesis : 5.19.3
sphinx : 3.1.2
blosc : None
feather : None
xlsxwriter : 1.2.9
lxml.etree : 4.5.2
html5lib : 1.1
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.16.1
pandas_datareader: None
bs4 : 4.9.1
bottleneck : 1.3.2
fastparquet : None
gcsfs : None
lxml.etree : 4.5.2
matplotlib : 3.2.2
numexpr : 2.7.1
odfpy : None
openpyxl : 3.0.4
pyarrow : None
pytables : None
pytest : 5.4.3
pyxlsb : None
s3fs : None
scipy : 1.3.1
sqlalchemy : 1.3.18
tables : 3.6.1
tabulate : None
xarray : None
xlrd : 1.2.0
xlwt : 1.3.0
xlsxwriter : 1.2.9
numba : 0.50.1
The text was updated successfully, but these errors were encountered: