pandera.schema_components.Index¶
-
class
pandera.schema_components.
Index
(pandas_dtype=None, checks=None, nullable=False, allow_duplicates=True, coerce=False, name=None)[source]¶ Validate types and properties of a DataFrame Index.
Initialize series schema base object.
- Parameters
pandas_dtype (
Union
[str
,type
,PandasDtype
,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 (callable) –
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.nullable (bool) – Whether or not column can contain null values.
allow_duplicates (bool) –
Attributes
allow_duplicates
Whether to allow duplicate values.
checks
Return list of checks or hypotheses.
coerce
Whether to coerce series to specified type.
dtype
String representation of the dtype.
name
Get SeriesSchema name.
names
Get index names in the Index schema component.
nullable
Whether the series is nullable.
pandas_dtype
Get the pandas dtype
pdtype
PandasDtype of the series.
Methods
Generate an example of a particular size.
Create a
hypothesis
strategy for generating an Index.Generate column data object for use by MultiIndex strategy.
Validate DataFrameSchema or SeriesSchema Index.
Alias for
validate
method.