Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: removed median percentile to be always included in describe GH #60550 #60557

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
8 changes: 4 additions & 4 deletions pandas/core/methods/describe.py
Original file line number Diff line number Diff line change
Expand Up @@ -351,13 +351,13 @@ def _refine_percentiles(
# explicit conversion of `percentiles` to list
percentiles = list(percentiles)

# median should be included only if blank list is passed
if len(percentiles) == 0:
percentiles.append(0.5)
ZenithClown marked this conversation as resolved.
Show resolved Hide resolved

# get them all to be in [0, 1]
validate_percentile(percentiles)

# median should always be included
if 0.5 not in percentiles:
percentiles.append(0.5)

percentiles = np.asarray(percentiles)

# sort and check for duplicates
Expand Down
Loading