columns (list of str, optional) – Column names to convert. Only valid for a DataFrame. If None
on a DataFrame, converts every string-like column that contains
duplicate values. Required to be None for a Series.
Returns:
Same type as input, with the selected columns (or the Series
itself) converted to Categorical.