Skip to content

Add key to sorting functions #3942

Closed
@hayd

Description

@hayd

Many python functions (sorting, max/min) accept a key argument, perhaps they could in pandas too.

.

The terrible motivating example was this awful hack from this question.... for which maybe one could do

df.sort_index(key=lambda t: literal_eval(t[1:-1]))

This would still be an awful awful hack, but a slightly less awful one.

Metadata

Metadata

Assignees

No one assigned

    Labels

    API DesignAlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffEnhancement

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions