pandas.Categorical.remove_categories

pandas 3.1.1 · Arrays, scalars, and data types · method

Remove selected categories and mark observations using them as missing.

Call syntax

Categorical.remove_categories(removals)

Run the example

Edit the example and select Run Python to see the result.

Parameters

ParameterRequirementAccepted values and behavior
removals Required
Positional or keyword
category or list of categories

Supply categories to remove from the set of allowed values.

Returns

Categorical