PandasRegistry.get_categorical_obs()

PandasRegistry.get_categorical_obs()#

PandasRegistry.get_categorical_obs(name)[source]#

Get a variable and ensure it is categorical.

Each variable is converted to integer codes.

Parameters:

name (str) – Variable name to retrieve

Return type:

tuple[Var, CategoryMapping]

Returns:

liesel.Var object for the categorical variable and a CategoryMapping.

Raises:

TypeError – If any variable is not categorical