-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: MultiIndex.argsort / MultiIndex.sort_values #48406
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm.
Could you add a Benchmark for Nullable dtypes too?
Added a benchmark for nullable Int64 and updated the timings in the summary. However, the nullable index used in the asv does not contain any pd.NA values as numpy will raise if it encounters pd.NA. That is true for numpy.argsort (with a list of tuples) and numpy.lexsort so this isn't new behavior. Can handling pd.NA be an enhancement/bug fix for a separate PR? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Thanks @lukemanley |
* perf improvement in MultiIndex.argsort and MultiIndex.sort_values * whatsnew * add asv for Int64
doc/source/whatsnew/v1.6.0.rst
file if fixing a bug or adding a new feature.Perf improvement in
MultiIndex.argsort
andMultiIndex.sort_values
for the vast majority of cases (whereMultiIndex.argsort
is called without additional passthrough numpy parameters).Also, an xfail was removed because np.lexsort does not complain about complex dtype arrays whereas np.argsort will complain about an object array of tuples containing complex and non-complex dtypes.
ASV added: