Skip to content

BUG: Return type changed in percentile for higher precision q  #30586

@seberg

Description

@seberg

gh-29105 incorrectly and unintentionally changed the return type for some percentile operations:

np.percentile(np.ones(10, dtype="float32"), np.float64(3))

should have the q float64 ensure a float64 result type, but doesn't on account of incorrectly assuming that the arrays dtype trumps the result one in the old code.
The part pertaining to using a higher precision internally for q itself should be fine though.

Originally posted by @seberg in #29105 (comment)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions