Skip to content

Commit 0dae806

Browse files
authored
DOC - explaining how to exclude columns with the cleaner (#2025)
1 parent 27b147e commit 0dae806

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

skrub/_table_vectorizer.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,19 @@ class Cleaner(TransformerMixin, BaseEstimator):
313313
D float64
314314
dtype: object
315315
316+
Columns can be excluded from processing by combining the ``Cleaner`` with
317+
`:class:`~skrub.ApplyToCols`. For example, to exclude the datetime column from
318+
processing and keep it as a string, we can do:
319+
320+
>>> from skrub import ApplyToCols
321+
>>> import skrub.selectors as s
322+
>>> ApplyToCols(Cleaner(), s.all() - 'B').fit_transform(df)
323+
B A C D
324+
0 02/02/2024 one 1.5 1.5
325+
1 23/02/2024 two ... 2.0
326+
2 12/03/2024 two 12.2 2.5
327+
3 13/03/2024 three ... 3.0
328+
316329
We can inspect all the processing steps that were applied to a given column:
317330
318331
>>> cleaner.all_processing_steps_['A']

0 commit comments

Comments
 (0)