ENH: Add the observed
parameter to get_dummies
#60585
Labels
Categorical
Categorical Data Type
Enhancement
Needs Triage
Issue that has not been reviewed by a pandas team member
Feature Type
Adding new functionality to pandas
Changing existing functionality in pandas
Removing existing functionality in pandas
Problem Description
The
get_dummies
function creates columns for all possible values of categorical series and not the ones that are observed, or are actually in the passed dataframeExample:
Feature Description
Add the
observed
parameter to theget_dummies
function, which will have the same behavior as the parameter with the same name in the groupby functionsAlternative Solutions
Additional Context
No response
The text was updated successfully, but these errors were encountered: