class_docstr: Shared set-up checks and methods across numerical discretisers.
  
  Important: inherits fit() functionality and tags from BaseNumericalTransformer.
class_docstr_tok: ["Shared","set-up","checks","and","methods","across","numerical","discretisers",".","Important",":","inherits","fit","(",")","functionality","and","tags","from","BaseNumericalTransformer","."]
docstr: Sort the variable values into the intervals.
  
  Parameters
  ----------
  X: pandas dataframe of shape = [n_samples, n_features]
      The data to transform.
  
  Returns
  -------
  X_new: pandas dataframe of shape = [n_samples, n_features]
      The transformed data with the discrete variables.
docstr_tok: ["Sort","the","variable","values","into","the","intervals",".","Parameters","--","--","--","--","--","X",":","pandas","dataframe","of","shape","=","[","n_samples",",","n_features","]","The","data","to","transform",".","Returns","--","--","--","-","X_new",":","pandas","dataframe","of","shape","=","[","n_samples",",","n_features","]","The","transformed","data","with","the","discrete","variables","."]
code: def transform(self, X: pd.DataFrame) -> pd.DataFrame:
      """Sort the variable values into the intervals.
  
      Parameters
      ----------
      X: pandas dataframe of shape = [n_samples, n_features]
          The data to transform.
  
      Returns
      -------
      X_new: pandas dataframe of shape = [n_samples, n_features]
          The transformed data with the discrete variables.
      """
  
      # check input dataframe and if class was fitted
      X = super().transform(X)
  
      # transform variables
      if self.return_boundaries is True:
          for feature in self.variables_:
              X[feature] = pd.cut(
                  X[feature], self.binner_dict_[feature]
              )
          X[self.variables_] = X[self.variables_].astype(str)
  
      else:
          for feature in self.variables_:
              X[feature] = pd.cut(
                  X[feature], self.binner_dict_[feature], labels=False
              )
  
          # return object
          if self.return_object:
              X[self.variables_] = X[self.variables_].astype("O")
  
      return X
  
imports: import pandas
  from feature_engine._base_transformers.base_numerical import BaseNumericalTransformer
label_desc: Use image node_id 2 for calling the BaseDiscretiser obj's underlying member method code with example usage: obj.transform(X) and returns: X