@@ -595,6 +595,15 @@ def make_column_transformer(*transformers, **kwargs):
595
595
----------
596
596
*transformers : tuples of column selections and transformers
597
597
598
+ remainder : {'passthrough', 'drop'}, default 'passthrough'
599
+ By default, all remaining columns that were not specified in
600
+ `transformers` will be automatically passed through (default of
601
+ ``'passthrough'``). This subset of columns is concatenated with the
602
+ output of the transformers.
603
+ By using ``remainder='drop'``, only the specified columns in
604
+ `transformers` are transformed and combined in the output, and the
605
+ non-specified columns are dropped.
606
+
598
607
n_jobs : int, optional
599
608
Number of jobs to run in parallel (default 1).
600
609
@@ -627,8 +636,10 @@ def make_column_transformer(*transformers, **kwargs):
627
636
628
637
"""
629
638
n_jobs = kwargs .pop ('n_jobs' , 1 )
639
+ remainder = kwargs .pop ('remainder' , 'passthrough' )
630
640
if kwargs :
631
641
raise TypeError ('Unknown keyword arguments: "{}"'
632
642
.format (list (kwargs .keys ())[0 ]))
633
643
transformer_list = _get_transformer_list (transformers )
634
- return ColumnTransformer (transformer_list , n_jobs = n_jobs )
644
+ return ColumnTransformer (transformer_list , n_jobs = n_jobs ,
645
+ remainder = remainder )
0 commit comments