PipeProcessor Module
PipeProcessor
Bases: Pipeline
Class to sequentially process an arbitrary number of pandas.DataFrame.pipe functions.
Source code in dpipes/processor.py
ColumnPipeProcessor
Bases: PipeProcessor
Class to sequentially process an arbitrary number of pandas.DataFrame.pipe functions by column.
Source code in dpipes/processor.py
funcs = [functools.partial(f, cols=cols) for f in funcs]
instance-attribute
__init__(funcs, cols)
Instantiate processor.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
funcs |
T.Sequence[T.Callable]
|
An iterable collection of user-defined functions. Function signatures should match
|
required |
cols |
T.Optional[T.Union[str, T.Sequence[T.Union[str, T.Sequence[str]]]]]
|
An iterable collection of columns to apply respective functions to. If a single string or single list of strings is passed they will be broadcast across the sequence of functions. |
required |
Returns:
Type | Description |
---|---|
pd.DataFrame
|
A processed DataFrame. |