class_docstr: One-Hot-Encoder that groups infrequent values into one dummy variable.
  
  Code from https://github.com/jeongyoonlee/Kaggler/blob/master/kaggler/preprocessing/data.py
  
  Attributes:
      min_obs (int): minimum number of observation to create a dummy variable
      label_encoders (list of (dict, int)): label encoders and their maximums
                                            for columns
docstr: Encode one categorical column into sparse matrix with one-hot-encoding.
  
  Args:
      x (pandas.Series): a categorical column to encode
      i (int): column index
  
  Returns:
      X (scipy.sparse.coo_matrix): sparse matrix encoding a categorical
                                   variable into dummy variables
docstr_tok: ["Encode","one","categorical","column","into","sparse","matrix","with","one-hot-encoding",".","Args",":","x","(","pandas.Series",")",":","a","categorical","column","to","encode","i","(","int",")",":","column","index","Returns",":","X","(","scipy.sparse.coo_matrix",")",":","sparse","matrix","encoding","a","categorical","variable","into","dummy","variables"]
code: def _transform_col(self, x, i):
      """Encode one categorical column into sparse matrix with one-hot-encoding.
  
      Args:
          x (pandas.Series): a categorical column to encode
          i (int): column index
  
      Returns:
          X (scipy.sparse.coo_matrix): sparse matrix encoding a categorical
                                       variable into dummy variables
      """
  
      labels = self.label_encoder._transform_col(x, i)
      label_max = self.label_encoder.label_maxes[i]
  
      # build row and column index for non-zero values of a sparse matrix
      index = np.array(range(len(labels)))
      i = index[labels > 0]
      j = labels[labels > 0] - 1  # column index starts from 0
  
      if len(i) > 0:
          return sparse.coo_matrix(
              (np.ones_like(i), (i, j)), shape=(x.shape[0], label_max)
          )
      else:
          # if there is no non-zero value, return no matrix
          return None
  
imports: import logging
  import numpy
  import pandas
  from scipy import sparse
  from sklearn import base
label_desc: Use image node_id 3 for calling the OneHotEncoder obj's underlying member method code with example usage: obj._transform_col(x, i) and returns: sparse, None