DEPR: deprecate include/exclude on Series.describe (GH-54193)#65592
Open
jbrockmendel wants to merge 2 commits into
Open
DEPR: deprecate include/exclude on Series.describe (GH-54193)#65592jbrockmendel wants to merge 2 commits into
jbrockmendel wants to merge 2 commits into
Conversation
The include and exclude arguments are advertised in the Series.describe signature but have always been silently ignored. Emit Pandas4Warning so users find this out at call time instead of via the Notes section. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
jorisvandenbossche
approved these changes
May 12, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Series.describe(include=..., exclude=...)has always silently ignored those arguments. The docstring buries this in Notes — easy to miss, and a recent numpy change (banningquantileon complex) turned the silent ignore into a confusingTypeErrorfor the BUG: pd.Series.describe ignores include, exclude arguments #54193 reporter.Pandas4Warningwhen either argument is passed to a Series, so users find the issue at call time instead of by reading the Notes section. Behavior is otherwise unchanged.SeriesGroupBy.describe/GroupBy.describedocstrings since the same dispatch path goes throughdescribe_ndframe.closes #54193
Test plan
test_describe_include_exclude_deprecatedcoversinclude=[...],exclude=[...],include="all", and combined kwargs.test_groupby_empty_datasetto wrap theSeriesGroupBy.describe(**kwargs)calls withtm.assert_produces_warning(Pandas4Warning, ...)since all three parametrized kwargs sets now warn.pandas/tests/series/methods/test_describe.py,pandas/tests/frame/methods/test_describe.py,pandas/tests/groupby/methods/test_describe.py.🤖 Generated with Claude Code