def remove_categories(self, removals, inplace=False):
inplace = validate_bool_kwarg(inplace, '<STR_LIT>')<EOL>if not is_list_like(removals):<EOL><INDENT>removals = [removals]<EOL><DEDENT>removal_set = set(list(removals))<EOL>not_included = removal_set - set(self.dtype.categories)<EOL>new_categories = [c for c in self.dtype.categories<EOL>if c not in removal_set]<EOL>if any(isna(removals)):<EOL><INDENT>not_included = [x for x in not_included if notna(x)]<EOL>new_categories = [x for x in new_categories if notna(x)]<EOL><DEDENT>if len(not_included) != <NUM_LIT:0>:<EOL><INDENT>msg = "<STR_LIT>"<EOL>raise ValueError(msg.format(not_included=not_included))<EOL><DEDENT>return self.set_categories(new_categories, ordered=self.ordered,<EOL>rename=False, inplace=inplace)<EOL>
Remove the specified categories.

`removals` must be included in the old categories. Values which were in
the removed categories will be set to NaN

Parameters
----------
removals : category or list of categories
   The categories which should be removed.
inplace : bool, default False
   Whether or not to remove the categories inplace or return a copy of
   this categorical with removed categories.

Returns
-------
cat : Categorical with removed categories or None if inplace.

Raises
------
ValueError
    If the removals are not contained in the categories

See Also
--------
rename_categories
reorder_categories
add_categories
remove_unused_categories
set_categories