pandera.api.dataframe.model_components.FieldΒΆ
- pandera.api.dataframe.model_components.Field(*, eq=None, ne=None, gt=None, ge=None, lt=None, le=None, in_range=None, isin=None, notin=None, str_contains=None, str_endswith=None, str_length=None, str_matches=None, str_startswith=None, nullable=False, unique=False, coerce=False, regex=False, ignore_na=True, raise_warning=False, n_failure_cases=None, alias=None, check_name=None, dtype_kwargs=None, title=None, description=None, default=None, metadata=None, **kwargs)[source]ΒΆ
Column or index field specification of a DataFrameModel.
new in 0.5.0
Some arguments apply only to numeric dtypes and some apply only to
str. See the User Guide for more information.The keyword-only arguments for argument names
eqtostr_startswithare dispatched to the built-inCheckmethods if the value is a dictionary. If the value is a tuple, it is unpacked as positional arguments.- Parameters:
eq (
UnionType[Any,None]) β Check that the column/index is equal to a value. Seeequal_to()for more information.ne (
UnionType[Any,None]) β Check that the column/index is not equal to a value. Seenot_equal_to()for more information.gt (
UnionType[Any,None]) β Check that the column/index is greater than a value. Seegreater_than()for more information.ge (
UnionType[Any,None]) β Check that the column/index is greater than or equal to a value. Seegreater_than_or_equal_to()for more information.lt (
UnionType[Any,None]) β Check that the column/index is less than a value. Seeless_than()for more information.le (
UnionType[Any,None]) β Check that the column/index is less than or equal to a value. Seeless_than_or_equal_to()for more information.in_range (
Union[tuple[Any,Any],tuple[Any,Any,bool,bool],tuple[Any,Any,bool,bool,bool],tuple[Any,Any,bool,bool,bool,bool],dict[str,Any],None]) β Check that the column/index is within a range. Seein_range()for more information.isin (
UnionType[Iterable[Any],None]) β Check that the column/index is in a set of values. Seeisin()for more information.notin (
UnionType[Iterable[Any],None]) β Check that the column/index is not in a set of values. Seenotin()for more information.str_contains (
UnionType[str,None]) β Check that the column/index contains a substring. Seestr_contains()for more information.str_endswith (
UnionType[str,None]) β Check that the column/index ends with a substring. Seestr_endswith()for more information.str_length (
Union[int,tuple[int],tuple[int,int],dict[str,int],None]) β Check that the length of the column/index is within a range. Seestr_length()for more information.str_matches (
UnionType[str,None]) β Check that the column/index matches a regex pattern. Seestr_matches()for more information.str_startswith (
UnionType[str,None]) β Check that the column/index starts with a substring. Seestr_startswith()for more information.nullable (
bool) β Whether or not the column/index can contain null values.unique (
bool) β Whether column values should be unique.coerce (
bool) β coerces the data type ifTrue.regex (
bool) β whether or not the field name or alias is a regex pattern.ignore_na (
bool) β whether or not to ignore null values in the checks.raise_warning (
bool) β raise a warning instead of an Exception.n_failure_cases (
UnionType[int,None]) β report the first n unique failure cases. If None, report all failure cases.alias (
UnionType[Any,None]) β The public name of the column/index.check_name (
UnionType[bool,None]) β Whether to check the name of the column/index during validation. None is the default behavior, which translates to True for columns and multi-index, and to False for a single index.dtype_kwargs (
UnionType[dict[str,Any],None]) β The parameters to be forwarded to the type of the field.title (
UnionType[str,None]) β A human-readable label for the field.description (
UnionType[str,None]) β An arbitrary textual description of the field.default (
UnionType[Any,None]) β Optional default value of the field.metadata (
UnionType[dict[str,Any],None]) β An optional key-value data.kwargs (
Any) β Specify custom checks that have been registered with theregister_check_methoddecorator.
- Return type: