def _transform_count_encode(self, X_in, y):
    'Perform the transform count encoding.'
    X = X_in.copy(deep=True)
    for col in self.cols:
        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].map(self.mapping[col])
        if isinstance(self._handle_unknown[col], np.integer):
            X[col] = X[col].fillna(self._handle_unknown[col])
        elif ((self._handle_unknown[col] == 'error') and X[col].isna().any()):
            raise ValueError(('Missing data found in column %s at transform time.' % (col,)))
    return (X, self.mapping)
Perform the transform count encoding.
def _transform_count_encode(self, X_in, y):
    
    X = X_in.copy(deep=True)
    for col in self.cols:
        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].map(self.mapping[col])
        if isinstance(self._handle_unknown[col], np.integer):
            X[col] = X[col].fillna(self._handle_unknown[col])
        elif ((self._handle_unknown[col] == 'error') and X[col].isna().any()):
            raise ValueError(('Missing data found in column %s at transform time.' % (col,)))
    return (X, self.mapping)