@@ -609,6 +609,15 @@ def make_column_transformer(*transformers, **kwargs):
609
609
----------
610
610
*transformers : tuples of column selections and transformers
611
611
612
+ remainder : {'passthrough', 'drop'}, default 'passthrough'
613
+ By default, all remaining columns that were not specified in
614
+ `transformers` will be automatically passed through (default of
615
+ ``'passthrough'``). This subset of columns is concatenated with the
616
+ output of the transformers.
617
+ By using ``remainder='drop'``, only the specified columns in
618
+ `transformers` are transformed and combined in the output, and the
619
+ non-specified columns are dropped.
620
+
612
621
n_jobs : int, optional
613
622
Number of jobs to run in parallel (default 1).
614
623
@@ -641,8 +650,10 @@ def make_column_transformer(*transformers, **kwargs):
641
650
642
651
"""
643
652
n_jobs = kwargs .pop ('n_jobs' , 1 )
653
+ remainder = kwargs .pop ('remainder' , 'passthrough' )
644
654
if kwargs :
645
655
raise TypeError ('Unknown keyword arguments: "{}"'
646
656
.format (list (kwargs .keys ())[0 ]))
647
657
transformer_list = _get_transformer_list (transformers )
648
- return ColumnTransformer (transformer_list , n_jobs = n_jobs )
658
+ return ColumnTransformer (transformer_list , n_jobs = n_jobs ,
659
+ remainder = remainder )
0 commit comments