Skip to content

Commit

Permalink
ENH: removed median percentile to be always included in describe
Browse files Browse the repository at this point in the history
- fixes #60550
- median percentile is default when a blank list of percentiles is passed
  • Loading branch information
ZenithClown committed Dec 13, 2024
1 parent c52846f commit 05709ef
Showing 1 changed file with 4 additions and 4 deletions.
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)

# 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

0 comments on commit 05709ef

Please sign in to comment.