pandas output (set_output)

set_output(transform='pandas') makes transformers return pandas DataFrames, with column names, rather than NumPy arrays. This makes it easier to inspect, diagnose, and interpret variables after a ColumnTransformer or a pipeline.

Example

preprocess.set_output(transform='pandas')

Related concepts

The whole glossary