docstr: Perform the count encoding.
docstr_tok: ["Perform","the","count","encoding","."]
code: def _fit_count_encode(self, X_in, y):
      """Perform the count encoding."""
      X = X_in.copy(deep=True)
  
      if self.cols is None:
          self.cols = X.columns
  
      self.mapping = {}
  
      for col in self.cols:
          mapping_values = X[col].value_counts(
              normalize=self._normalize[col]
          )
          ordinal_encoding = [
              m["mapping"]
              for m in self.ordinal_encoder.mapping
              if m["col"] == col
          ][0]
          reversed_ordinal_enc = {
              v: k for k, v in ordinal_encoding.to_dict().items()
          }
          mapping_values.index = mapping_values.index.map(
              reversed_ordinal_enc
          )
          self.mapping[col] = mapping_values
  
          if self._handle_missing[col] == "return_nan":
              self.mapping[col][np.NaN] = np.NaN
  
          # elif self._handle_missing[col] == 'value':
          # test_count.py failing     self.mapping[col].loc[-2] = 0
  
      if any(
          [val is not None for val in self._min_group_size.values()]
      ):
          self.combine_min_categories(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 4 for calling the CountEncoder obj's underlying member method code with example usage: obj._fit_count_encode(X_in, y) without return types