pandera.engines.pandas_engine.Category#

class pandera.engines.pandas_engine.Category(categories=None, ordered=False)[source]#

Semantic representation of a pandas.CategoricalDtype.

Attributes

auto_coerce

Whether to force coerce to be True in all cases

categories

continuous

Whether the number data type is continuous.

ordered

type

Native pandas dtype boxed by the data type.

Methods

__init__

check

Check that pandera DataType are equivalent.

coerce

Pure coerce without catching exceptions.

coerce_value

Coerce an value to a particular type.

from_parametrized_dtype

Convert a categorical to a Pandera pandera.dtypes.pandas_engine.Category.

try_coerce

Coerce data container to the data type, raises a ParserError if the coercion fails :raises: ParserError: if coercion fails

__call__

Coerce data container to the data type.