Column.__init__(dtype=None, checks=None, nullable=False, unique=False, coerce=False, required=True, name=None, regex=False, title=None, description=None, default=None, metadata=None, drop_invalid_rows=False, **column_kwargs)[source]ΒΆ

Create column validator object.

  • dtype (Union[str, type, DataTypeClass]) – datatype of the column. The datatype for type-checking a dataframe. All polars datatypes, supported built-in python types that are supported by polars, and the pandera polars engine datatypes.

  • checks (Union[Check, List[Union[Check, Hypothesis]], None]) – checks to verify validity of the column

  • nullable (bool) – Whether or not column can contain null values.

  • unique (bool) – whether column values should be unique

  • coerce (bool) – If True, when schema.validate is called the column will be coerced into the specified dtype. This has no effect on columns where dtype=None.

  • required (bool) – Whether or not column is allowed to be missing

  • name (Optional[str, None]) – column name in dataframe to validate. Names in the format β€˜^{regex_pattern}$’ are treated as regular expressions. During validation, this schema will be applied to any columns matching this pattern.

  • regex (bool) – whether the name attribute should be treated as a regex pattern to apply to multiple columns in a dataframe. If the name is a regular expression, this attribute will automatically be set to True.

  • title (Optional[str, None]) – A human-readable label for the column.

  • description (Optional[str, None]) – An arbitrary textual description of the column.

  • default (Optional[Any, None]) – The default value for missing values in the column.

  • metadata (Optional[dict, None]) – An optional key value data.

  • drop_invalid_rows (bool) – if True, drop invalid rows on validation.


SchemaInitError – if impossible to build schema from parameters


>>> import pandas as pd
>>> import pandera as pa
>>> schema = pa.DataFrameSchema({
...     "column": pa.Column(str)
... })
>>> schema.validate(pd.DataFrame({"column": ["foo", "bar"]}))
0    foo
1    bar

See here for more usage details.