-
-
Notifications
You must be signed in to change notification settings - Fork 12.4k
ENH: New-style object sorting with descending support and NaN handling #31431
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
Merged
Merged
Changes from all commits
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
27207a1
ENH: New-style ArrayMethod object sorting with NaN handling
MaanasArora 6989dbc
BUG: Add sentinel guard for out-of-bound argsorts
MaanasArora cd542e2
BUG: Correct return value on rich compare error
MaanasArora ae05df2
REF: Rewrite object tag comparisons
MaanasArora 650dcd6
REF: New `_cmp` function to reuse in object `less`, `greater`, -1 for…
MaanasArora 87bb30a
ENH: Error handling and early exit in sorts using NPY_CMP macro
MaanasArora 9255027
Revert "ENH: Error handling and early exit in sorts using NPY_CMP macro"
MaanasArora 90d0857
ENH: Handle errors from `cmp` in sort functions
MaanasArora 72aed9d
BUG: Switch NULLs to None in object comparison null handling
MaanasArora 4865d3a
REF: Simplify object comparison handling in quicksort and aquicksort …
MaanasArora ff962da
BENCH: Add object dtype to sort benchmarks
MaanasArora 2ddcb7d
REF: Fix indentation
MaanasArora c81cb08
BUG: Fix swapped parametrizations
MaanasArora 707143a
ENH: Add `greater_equal` to simple dtypes and use in timsort to avoid…
MaanasArora d8a7577
ENH: Fix use of `Py_LE/GE` and instead invert op for object sort comp…
MaanasArora a84f7b6
ENH: Optimize `less_equal` and `greater_equal` for `npy_half` type
MaanasArora 6d83c91
DOC: Add release note
MaanasArora 2c2ac85
Revert "ENH: Optimize `less_equal` and `greater_equal` for `npy_half`…
MaanasArora a99ba57
Revert "ENH: Fix use of `Py_LE/GE` and instead invert op for object s…
MaanasArora f2133e2
Revert "ENH: Add `greater_equal` to simple dtypes and use in timsort …
MaanasArora 0fc1796
DOC: Clarify release note
MaanasArora 792194f
TST: Fix casting of object arrays in sorting nan test
MaanasArora efe1704
BUG: Fix comparison logic in heapsort and aheapsort implementations
MaanasArora cea79da
STYLE: Remove unnecessary blank line
MaanasArora c279e21
DOC: Update release notes to clarify object array sorting behavior wi…
MaanasArora 3a4f554
Remove presumably unnecessary with errstate and small tweak
seberg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Object array sorting supports ``descending=True`` and consistently sorts NaN-like objects | ||
| ----------------------------------------------------------------------------------------- | ||
| `np.sort` and `np.argsort` with arrays of dtype ``object`` | ||
| now support passing `descending=True` to sort in descending order. Objects that | ||
| compare as not equal to themselves (``obj != obj``), such as NaN-like objects, | ||
| are considered unordered and are sorted to the end of the array, regardless of | ||
| the value of ``descending``. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.