code: def _transform(self, X):
      for col in self.cols:
          # Treat None as np.nan
          X[col] = pd.Series(
              [el if el is not None else np.NaN for el in X[col]],
              index=X[col].index,
          )
          if self.handle_missing == "value":
              if not util.is_category(X[col].dtype):
                  X[col] = X[col].fillna(np.nan)
  
          if self._min_group_size is not None:
              if col in self._min_group_categories.keys():
                  X[col] = (
                      X[col]
                      .map(self._min_group_categories[col])
                      .fillna(X[col])
                  )
  
          X[col] = X[col].astype(object).map(self.mapping[col])
          if isinstance(self._handle_unknown[col], (int, np.integer)):
              X[col] = X[col].fillna(self._handle_unknown[col])
  
          elif (
              self._handle_unknown[col] == "value"
              and X[col].isna().any()
              and self._handle_missing[col] != "return_nan"
          ):
              X[col] = X[col].replace(np.nan, 0)
  
          elif (
              self._handle_unknown[col] == "error"
              and X[col].isna().any()
          ):
              raise ValueError(
                  f"Missing data found in column {col} at transform time."
              )
      return X
  
file_path: category_encoders/category_encoders/count.py
imports: import numpy
  import pandas
  import category_encoders.utils
  from category_encoders.ordinal import OrdinalEncoder
  from copy import copy
label_desc: Use image node_id 3 for calling the CountEncoder obj's underlying member method code with example usage: obj._transform(X) and returns: X