traveler.demo.work_location.CategoricalArray.from_pandas#
- classmethod CategoricalArray.from_pandas(x)[source]#
Create a categorical array from a pandas categorical series.
- Parameters:
x (pandas.Series) – Series whose dtype is categorical.
- Returns:
Array containing the series categories, codes, and ordering.
- Return type:
- Raises:
ValueError – If the series does not have a categorical dtype.