Skip to content

Suggestion: percentile ranks #5971

Closed
@MichaelWS

Description

@MichaelWS

I realize I am computing percentile ranks constantly in my code.

df["pct_rank"] = df["field"].groupby("date").transform(lambda x: x.rank(ascending=False) / float(x.count()))

Would anyone have any use for a function that is computed in cython for this?

if so, would people prefer to it to be a separate function or an option in rank?

Metadata

Metadata

Assignees

No one assigned

    Labels

    AlgosNon-arithmetic algos: value_counts, factorize, sorting, isin, clip, shift, diffEnhancementGroupbyNumeric OperationsArithmetic, Comparison, and Logical operations

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions