Skip to content

ExtensionArray.argsort and nargsort #27218

Closed
@TomAugspurger

Description

@TomAugspurger

47ffcd6 changes how we handle sorting EAs. We've made nargsort compatible with extension arrays. It now calls ExtensionArray._values_for_argsort and then applies pandas nargsort sorting algorithm to the values.

This may have broken the (implied) ability for ExtensionArray's to "bring their own" sorting algorithm. For example, you can imagine a GPU-backed EA that has a very fast sorting algorithm available. While ExtensionArray.argsort can use that custom sorting algo, pandas may not. Anywhere that uses nargsort(obj) will now essentially do nargsort(thing._values_for_argsort()) for EAs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions