Repository navigation
Closes #5424: argsort to Series accessor - #5425
Merged
Merged
Conversation
ajpotts
force-pushed
the
5424_argsort_to_Series_accessor
branch
from
February 20, 2026 22:30
d03ae3a to
0eed992
Compare
ajpotts
marked this pull request as ready for review
February 20, 2026 23:50
ajpotts
marked this pull request as draft
February 23, 2026 14:40
ajpotts
force-pushed
the
5424_argsort_to_Series_accessor
branch
from
February 23, 2026 15:38
0eed992 to
a657be3
Compare
ajpotts
force-pushed
the
5424_argsort_to_Series_accessor
branch
from
February 23, 2026 15:47
a657be3 to
bb0003d
Compare
ajpotts
marked this pull request as ready for review
February 23, 2026 21:14
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR introduces a new
Series.ak.argsort()method that computes adistributed permutation on the Arkouda server and returns the result as
an
ArkoudaArray.Unlike
pandas.Series.argsort(), which returns a NumPy array andmaterializes data locally, this accessor-based implementation preserves
Arkouda's distributed execution model and avoids unnecessary client-side
conversion.
Motivation
pandas.Series.argsort()returns a NumPyndarray, even when theSeries is backed by an
ArkoudaExtensionArray. This behavior isconsistent with pandas' ExtensionArray contract but forces
materialization of the permutation indices on the client.
For distributed workflows, this is undesirable. Users need a way to:
to_ndarray()materializationtakewithout leaving ArkoudaThis PR provides that capability via the
.akaccessor.Changes
1.
ArkoudaSeriesAccessor.argsortAdded:
Behavior:
ak.argsortserver-sideascendingna_positionfor floatpdarrayArkoudaArrayTypeErrorfor non-Arkouda-backed SeriesValueErrorfor invalidna_position2. Unit Tests
Added comprehensive tests covering:
ArkoudaArray)NaNhandling (first/last)na_positionExample
Design Notes
This PR intentionally does not modify
Series.argsort().Maintaining pandas compatibility requires that the base method return a
NumPy indexer. The distributed behavior is therefore exposed explicitly
via the
.akaccessor.This separation keeps:
Performance Impact
Backwards Compatibility
.akaccessorCloses #5424: argsort to Series accessor