survival.column.encode_categorical

survival.column.encode_categorical(table, **kwargs)

Encode categorical columns with M categories into M-1 columns according to the one-hot scheme.

Parameters:

table : pandas.DataFrame

Table with categorical columns to encode.

allow_drop : boolean, optional, default=True

Whether to allow dropping categorical columns that only consist of a single category.

Returns:

encoded : pandas.DataFrame

Table with categorical columns encoded as numeric. Numeric columns in the input table remain unchanged.