@@ -63,7 +63,7 @@ def fit(self, X, y=None):
6363 SelectCols
6464 The transformer itself.
6565 """
66- self ._columns = s .make_selector (self .cols ).expand (X )
66+ self .columns_ = s .make_selector (self .cols ).expand (X )
6767 return self
6868
6969 def transform (self , X ):
@@ -80,7 +80,7 @@ def transform(self, X):
8080 The input DataFrame ``X`` after selecting only the columns listed
8181 in ``self.cols`` (in the provided order).
8282 """
83- return s .select (X , self ._columns )
83+ return s .select (X , self .columns_ )
8484
8585 def get_feature_names_out (self , input_features = None ):
8686 """Get output feature names for transformation.
@@ -95,8 +95,8 @@ def get_feature_names_out(self, input_features=None):
9595 feature_names_out : ndarray of str objects
9696 Transformed feature names.
9797 """
98- check_is_fitted (self , "_columns " )
99- return self ._columns
98+ check_is_fitted (self , "columns_ " )
99+ return self .columns_
100100
101101
102102class DropCols (TransformerMixin , BaseEstimator ):
@@ -159,8 +159,8 @@ def fit(self, X, y=None):
159159 The transformer itself.
160160 """
161161 selector = s .make_selector (self .cols )
162- self ._kept_cols = (~ selector ).expand (X )
163- self ._dropped_cols = selector .expand (X )
162+ self .kept_cols_ = (~ selector ).expand (X )
163+ self .dropped_cols_ = selector .expand (X )
164164 return self
165165
166166 def transform (self , X ):
@@ -177,7 +177,7 @@ def transform(self, X):
177177 The input DataFrame ``X`` after dropping the columns listed in
178178 ``self.cols``.
179179 """
180- return s .select (X , s .make_selector (self ._kept_cols ))
180+ return s .select (X , s .make_selector (self .kept_cols_ ))
181181
182182 def get_feature_names_out (self , input_features = None ):
183183 """Get output feature names for transformation.
@@ -192,8 +192,8 @@ def get_feature_names_out(self, input_features=None):
192192 feature_names_out : ndarray of str objects
193193 Transformed feature names.
194194 """
195- check_is_fitted (self , "_kept_cols " )
196- return self ._kept_cols
195+ check_is_fitted (self , "kept_cols_ " )
196+ return self .kept_cols_
197197
198198
199199class Drop (SingleColumnTransformer ):
0 commit comments