pandera.api.dataframe.model_components.check(*fields, regex=False, **check_kwargs)[source]

Defines DataFrameModel check methods for columns/indexes.

new in 0.5.0

This indicates that the decorated method should be used to validate a field (column or index). The method will be converted to a classmethod. Therefore its signature must start with cls followed by regular check arguments. See the User Guide for more.

  • _fn – Method to decorate.

  • check_kwargs – Keywords arguments forwarded to Check.

Return type:

Callable[[Union[classmethod, Callable[…, Any]]], classmethod]