.. pandera documentation for seriesschemas .. currentmodule:: pandera .. _SeriesSchemas: Series Schemas ============== The :class:`~pandera.api.pandas.array.SeriesSchema` class allows for the validation of pandas ``Series`` objects, and are very similar to :ref:`columns` and :ref:`indexes` described in :ref:`DataFrameSchemas`. .. testcode:: series_validation import pandas as pd import pandera as pa # specify multiple validators schema = pa.SeriesSchema( str, checks=[ pa.Check(lambda s: s.str.startswith("foo")), pa.Check(lambda s: s.str.endswith("bar")), pa.Check(lambda x: len(x) > 3, element_wise=True) ], nullable=False, unique=False, name="my_series") validated_series = schema.validate( pd.Series(["foobar", "foobar", "foobar"], name="my_series")) print(validated_series) .. testoutput:: series_validation 0 foobar 1 foobar 2 foobar Name: my_series, dtype: object