@@ -70,7 +70,7 @@ class DataFrameMapper(BaseEstimator, TransformerMixin):
70
70
"""
71
71
72
72
def __init__ (self , features , default = False , sparse = False , df_out = False ,
73
- input_df = False , show_progress = False ):
73
+ input_df = False , show_progressbar = False ):
74
74
"""
75
75
Params:
76
76
@@ -102,6 +102,9 @@ def __init__(self, features, default=False, sparse=False, df_out=False,
102
102
input_df If ``True`` pass the selected columns to the transformers
103
103
as a pandas DataFrame or Series. Otherwise pass them as a
104
104
numpy array. Defaults to ``False``.
105
+
106
+ show_progressbar if ``True`` a progress bar will be shown during fit
107
+ and transform method. Defaults to ``False``
105
108
"""
106
109
self .features = features
107
110
self .built_features = None
@@ -111,7 +114,7 @@ def __init__(self, features, default=False, sparse=False, df_out=False,
111
114
self .df_out = df_out
112
115
self .input_df = input_df
113
116
self .transformed_names_ = []
114
- self .show_progress = show_progress
117
+ self .show_progressbar = show_progressbar
115
118
116
119
if (df_out and (sparse or default )):
117
120
raise ValueError ("Can not use df_out with sparse or default" )
@@ -211,7 +214,7 @@ def fit(self, X, y=None):
211
214
212
215
"""
213
216
self ._build ()
214
- pbar = tqdm (self .built_features , disable = not self .show_progress )
217
+ pbar = tqdm (self .built_features , disable = not self .show_progressbar )
215
218
for columns , transformers , options in pbar :
216
219
pbar .set_description ("[Fit] %s" % columns )
217
220
input_df = options .get ('input_df' , self .input_df )
@@ -299,10 +302,9 @@ def _transform(self, X, y=None, do_fit=False):
299
302
if do_fit :
300
303
self ._build ()
301
304
302
-
303
305
extracted = []
304
306
self .transformed_names_ = []
305
- pbar = tqdm (self .built_features , disable = not self .show_progress )
307
+ pbar = tqdm (self .built_features , disable = not self .show_progressbar )
306
308
for columns , transformers , options in pbar :
307
309
pbar .set_description ("[Transform] %s" % columns )
308
310
input_df = options .get ('input_df' , self .input_df )
0 commit comments