code: def fit_transform(self, X, y=None, **fit_params):
          
          columns_to_encode = X.select_dtypes(include=["object", "category"]).columns
          x_dummy = self._encode(X, columns_to_encode)
  
          self.feature_names_ = columns_to_encode
          self.categories_ = {k: X[k].cat.categories for k in columns_to_encode}
          self.encoded_columns_ = x_dummy.columns
          return x_dummy
docs: Convert categorical columns to numeric values.
  
          Parameters
          ----------
          X : pandas.DataFrame
              Data to encode.
          y :
              Ignored. For compatibility with TransformerMixin.
          fit_params :
              Ignored. For compatibility with TransformerMixin.
  
          Returns
          -------
          Xt : pandas.DataFrame
              Encoded data.