pandera.decisions.holds

pandera.decisions.holds(instructions, *, context=None, min_probability=0.5, provider=None, name=None)[source]

The predicate behind Holds(), for use inside @dataframe_check.

Holds returns a Check, which is what DataFrameSchema(checks=...) and Field(checks=...) want. A @pa.dataframe_check method wants the boolean Series itself:

@pa.dataframe_check
def name_fits_category(cls, df):
    return decisions.holds(
        "The name fits the category",
        context=["name", "category"],
    )(df)
Return type:

Any