code: def fit_transform(self, df):
          
          self.index_ = df.index
          self.columns_ = df.columns
          self.cat_columns_ = df.select_dtypes(include=['category']).columns
          self.non_cat_columns_ = df.columns.drop(self.cat_columns_)
          self.cat_map_ = {col: df[col].cat for col in self.cat_columns_}
  
          # Store all the information about categories/values so we can 'back map' later
          left = len(self.non_cat_columns_)
          self.cat_blocks_ = {}
          for col in self.cat_columns_:
              right = left + len(df[col].cat.categories)
              self.cat_blocks_[col], left = slice(left, right), right
  
          # This is to ensure that transform always produces the same columns in the same order
          df_with_dummies = pd.get_dummies(df)
          self.columns_in_order = df_with_dummies.columns.tolist()
  
          # Return the numpy matrix
          return np.asarray(df_with_dummies)
docs: Fit method for the DummyEncoder