pandera.decisions.Holds¶
- pandera.decisions.Holds(instructions, *, context=None, min_probability=0.5, provider=None, name=None, **check_kwargs)[source]¶
Check that a statement holds of each row, as judged by a model.
schema = pa.DataFrameSchema( { "name": pa.Column(str), "category": pa.Column(str), "description": pa.Column(str), }, checks=decisions.Holds( "The description is a coherent description of a product " "belonging to the stated category", context=["name", "category", "description"], min_probability=0.85, ), )
Used as a column check, the column’s own value is what gets judged. Used as a dataframe check with
context, those columns are sent instead, which is the only way to judge a value relative to another column.Inside a
@pa.dataframe_checkmethod, useholds()instead – that wants the boolean Series, not aCheck.- Parameters:
- Return type: