Skip to content
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

BUG: freq after sort values differs between arm Mac and ubuntu #59092

Open
2 of 3 tasks
phofl opened this issue Jun 25, 2024 · 2 comments
Open
2 of 3 tasks

BUG: freq after sort values differs between arm Mac and ubuntu #59092

phofl opened this issue Jun 25, 2024 · 2 comments
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@phofl
Copy link
Member

phofl commented Jun 25, 2024

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

pdf = pd.DataFrame({"z": 1})
pdf.z.sort_values()


2020-12-31    1
2021-01-01    1
2021-01-02    1
2021-01-03    1
2021-01-04    1
             ..
2021-04-05    1
2021-04-06    1
2021-04-07    1
2021-04-08    1
2021-04-09    1
Freq: D, Name: z, Length: 100, dtype: int64

Issue Description

This preserves the freq on ubuntu but loses it on Mac

Expected Behavior

don't know, consistency above everything else

I can't test the nightlies on ubuntu right now, that's why it's only 2.2.2

Installed Versions

INSTALLED VERSIONS

commit : d9cdd2e
python : 3.12.4.final.0
python-bits : 64
OS : Darwin
OS-release : 23.3.0
Version : Darwin Kernel Version 23.3.0: Wed Dec 20 21:33:31 PST 2023; root:xnu-10002.81.5~7/RELEASE_ARM64_T8112
machine : arm64
processor : arm
byteorder : little
LC_ALL : None
LANG : None
LOCALE : None.UTF-8

pandas : 2.2.2
numpy : 2.0.0
pytz : 2024.1
dateutil : 2.9.0
setuptools : 70.1.0
pip : 24.0
Cython : None
pytest : 8.2.2
hypothesis : None
sphinx : None
blosc : None
feather : None
xlsxwriter : None
lxml.etree : None
html5lib : None
pymysql : None
psycopg2 : None
jinja2 : 3.1.4
IPython : 8.25.0
pandas_datareader : None
adbc-driver-postgresql: None
adbc-driver-sqlite : None
bs4 : 4.12.3
bottleneck : None
dataframe-api-compat : None
fastparquet : None
fsspec : 2024.6.0
gcsfs : None
matplotlib : None
numba : None
numexpr : None
odfpy : None
openpyxl : None
pandas_gbq : None
pyarrow : 16.1.0
pyreadstat : None
python-calamine : None
pyxlsb : None
s3fs : 2024.6.0
scipy : None
sqlalchemy : None
tables : None
tabulate : None
xarray : 2024.6.0
xlrd : None
zstandard : None
tzdata : 2024.1
qtpy : None
pyqt5 : None
None

@phofl phofl added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Jun 25, 2024
@phofl
Copy link
Member Author

phofl commented Jun 25, 2024

cc @jbrockmendel thoughts here?

@jbrockmendel
Copy link
Member

I don't have an ubuntu env ATM, so speculating: sort_values go through nargsort which I suspect may have undefined behavior in non-unique cases.

BTW the example in the OP is not reproducible, needs an index passed to DataFrame.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

No branches or pull requests

2 participants