pandera.api.pandas.array.SeriesSchema#

class pandera.api.pandas.array.SeriesSchema(dtype=None, checks=None, index=None, nullable=False, unique=False, report_duplicates='all', coerce=False, name=None, title=None, description=None)[source]#

Series validator.

Initialize series schema base object.

Parameters
  • dtype (Union[str, type, DataType, Type, ExtensionDtype, dtype, None]) – datatype of the column. If a string is specified, then assumes one of the valid pandas string values: http://pandas.pydata.org/pandas-docs/stable/basics.html#dtypes

  • checks (Union[Check, List[Union[Check, Hypothesis]], None]) –

    If element_wise is True, then callable signature should be:

    Callable[Any, bool] where the Any input is a scalar element in the column. Otherwise, the input is assumed to be a pandas.Series object.

  • index – specify the datatypes and properties of the index.

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

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

  • report_duplicates (Union[Literal[‘exclude_first’], Literal[‘exclude_last’], Literal[‘all’]]) – how to report unique errors - exclude_first: report all duplicates except first occurence - exclude_last: report all duplicates except last occurence - all: (default) report all duplicates

  • 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.

  • name (Optional[str]) – series name.

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

  • description (Optional[str]) – An arbitrary textual description of the series.

Attributes

BACKEND

dtype

Get the pandas dtype

properties

Get the properties of the schema for serialization purposes.

Methods

__init__

Initialize series schema base object.

example

Generate an example of a particular size.

validate

Validate a Series object.

__call__

Alias for validate method.