Column.__init__(pandas_dtype=None, checks=None, nullable=False, allow_duplicates=True, coerce=False, required=True, name=None, regex=False)[source]

Create column validator object.

  • pandas_dtype (Union[str, type, PandasDtype, ExtensionDtype, dtype, None]) – datatype of the column. A PandasDtype for type-checking dataframe. If a string is specified, then assumes one of the valid pandas string values:

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

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

  • allow_duplicates (bool) – Whether or not column can contain duplicate values.

  • coerce (bool) – If True, when schema.validate is called the column will be coerced into the specified dtype.

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

  • name (Optional[str]) – column name in dataframe to validate.

  • regex (bool) – whether the name attribute should be treated as a regex pattern to apply to multiple columns in a dataframe.


SchemaInitError – if impossible to build schema from parameters


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

See here for more usage details.