pandera.schemas.SeriesSchema¶
- class pandera.schemas.SeriesSchema(dtype=None, checks=None, index=None, nullable=False, allow_duplicates=True, coerce=False, name=None, pandas_dtype=None)[source]¶
Series validator.
Initialize series schema base object.
- Parameters
dtype (
Union
[str
,type
,DataType
,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#dtypeschecks (
Union
[Check
,Hypothesis
,List
[Union
[Check
,Hypothesis
]],None
]) –If element_wise is True, then callable signature should be:
Callable[Any, bool]
where theAny
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.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. This has no effect on columns wherepandas_dtype=None
.pandas_dtype (
Union
[str
,type
,DataType
,ExtensionDtype
,dtype
,None
]) –alias of
dtype
for backwards compatibility.Warning
This option will be deprecated in 0.8.0
Attributes
allow_duplicates
Whether to allow duplicate values.
checks
Return list of checks or hypotheses.
coerce
Whether to coerce series to specified type.
dtype
Get the pandas dtype
name
Get SeriesSchema name.
nullable
Whether the series is nullable.
Methods
Initialize series schema base object.
Validate a Series object.
Alias for
SeriesSchema.validate()
method.