pandera.decorators.check_io#

pandera.decorators.check_io(head=None, tail=None, sample=None, random_state=None, lazy=False, inplace=False, out=None, **inputs)[source]#

Check schema for multiple inputs and outputs.

See here for more usage details.

Parameters
  • head (Optional[int]) – validate the first n rows. Rows overlapping with tail or sample are de-duplicated.

  • tail (Optional[int]) – validate the last n rows. Rows overlapping with head or sample are de-duplicated.

  • sample (Optional[int]) – validate a random sample of n rows. Rows overlapping with head or tail are de-duplicated.

  • random_state (Optional[int]) – random seed for the sample argument.

  • lazy (bool) – if True, lazily evaluates dataframe against all validation checks and raises a SchemaErrors. Otherwise, raise SchemaError as soon as one occurs.

  • inplace (bool) – if True, applies coercion to the object of validation, otherwise creates a copy of the data.

  • out (Union[DataFrameSchema, SeriesSchema, Tuple[Union[str, int, Callable], Union[DataFrameSchema, SeriesSchema]], List[Tuple[Union[str, int, Callable], Union[DataFrameSchema, SeriesSchema]]], None]) – this should be a schema object if the function outputs a single dataframe/series. It can be a two-tuple, where the first element is a string, integer, or callable that fetches the pandas data structure in the output, and the second element is the schema to validate against. For multiple outputs, specify a list of two-tuples following the above structure.

  • inputs (Union[DataFrameSchema, SeriesSchema]) – kwargs keys should be the argument name in the decorated function and values should be the schema used to validate the pandas data structure referenced by the argument name.

Return type

Callable[[~F], ~F]

Returns

wrapped function