-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: sort_values create an unprintable object #39426
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
Comments
Also shape of DataFrame changes with this |
On master this is already raising with sort values
|
if you remove
If you change this to:
then you do actually get the result you want. |
Yes I know that it works with |
I provided the solution to correctly implement in Pandas, feel free to submit PR and check it satisfies all tests |
Instead of the |
take |
I have checked that this issue has not already been reported.
I have confirmed this bug exists on the latest version of pandas.
(optional) I have confirmed this bug exists on the master branch of pandas.
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
Problem description
[this should explain why the current behaviour is a problem and why the expected output is a better solution]
Printing object returned by
sort_values
produces an exception because some internal metadata is wrong:Expected Output
Output of
pd.show_versions()
[paste the output of
pd.show_versions()
here leaving a blank line after the details tag]INSTALLED VERSIONS
commit : 9d598a5
python : 3.8.6.final.0
python-bits : 64
OS : Linux
OS-release : 5.4.0-56-generic
Version : #62-Ubuntu SMP Mon Nov 23 19:20:19 UTC 2020
machine : x86_64
processor : x86_64
byteorder : little
LC_ALL : None
LANG : en_US.UTF-8
LOCALE : en_US.UTF-8
pandas : 1.2.1
numpy : 1.19.4
pytz : 2020.1
dateutil : 2.8.1
pip : 20.3.1
setuptools : 49.6.0.post20201009
Cython : None
pytest : 6.2.1
hypothesis : None
sphinx : None
blosc : None
feather : 0.4.1
xlsxwriter : None
lxml.etree : 4.6.2
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 2.11.2
IPython : 7.18.1
pandas_datareader: None
bs4 : 4.9.3
bottleneck : None
fsspec : 0.8.4
fastparquet : None
gcsfs : None
matplotlib : 3.2.2
numexpr : 2.7.1
odfpy : None
openpyxl : 3.0.5
pandas_gbq : 0.14.1
pyarrow : 2.0.0
pyxlsb : None
s3fs : 0.5.2
scipy : 1.5.4
sqlalchemy : 1.3.21
tables : 3.6.1
tabulate : None
xarray : 0.16.2
xlrd : 2.0.1
xlwt : None
numba : None
The text was updated successfully, but these errors were encountered: