pandas.Series.cat.remove_categories

pandas 3.1.1 · Series and accessors · method

Remove selected categories and mark observations using them as missing.

Call syntax

Series.cat.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