class_docstr: The ArbitraryDiscretiser() divides numerical variables into intervals which limits
  are determined by the user. Thus, it works only with numerical variables.
  
  You need to enter a dictionary with variable names as keys, and a list with
  the limits of the intervals as values. For example the key could be the variable
  name 'var1' and the value the following list: [0, 10, 100, 1000]. The
  ArbitraryDiscretiser() will then sort var1 values into the intervals 0-10,
  10-100, 100-1000, and var2 into 5-10, 10-15 and 15-20. Similar to `pandas.cut`.
  
  More details in the :ref:`User Guide <arbitrary_discretiser>`.
  
  Parameters
  ----------
  binning_dict: dict
      The dictionary with the variable to interval limits pairs.
  
  {return_object}
  
  {return_boundaries}
  
  errors: string, default='ignore'
      Indicates what to do when a value is outside the limits indicated in the
      'binning_dict'. If 'raise', the transformation will raise an error.
      If 'ignore', values outside the limits are returned as NaN
      and a warning will be raised instead.
  
  Attributes
  ----------
  {binner_dict_}
  
  {variables_}
  
  {feature_names_in_}
  
  {n_features_in_}
  
  Methods
  -------
  {fit}
  
  {fit_transform}
  
  {transform}
  
  See Also
  --------
  pandas.cut
  
  Examples
  --------
  
  >>> import pandas as pd
  >>> import numpy as np
  >>> from feature_engine.discretisation import ArbitraryDiscretiser
  >>> np.random.seed(42)
  >>> X = pd.DataFrame(dict(x = np.random.randint(1,100, 100)))
  >>> bins = dict(x =  [0, 25, 50, 75, 100])
  >>> ad = ArbitraryDiscretiser(binning_dict = bins)
  >>> ad.fit(X)
  >>> ad.transform(X)["x"].value_counts()
  2    31
  0    27
  3    25
  1    17
  Name: x, dtype: int64
docstr: Sort the variable values into the intervals.
  
  Parameters
  ----------
  X: pandas dataframe of shape = [n_samples, n_features]
      The dataframe to be transformed.
  
  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","dataframe","to","be","transformed",".","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 dataframe to be transformed.
  
      Returns
      -------
      X_new: pandas dataframe of shape = [n_samples, n_features]
          The transformed data with the discrete variables.
      """
  
      X = super().transform(X)
      # check if NaN values were introduced by the discretisation procedure.
      if X[self.variables_].isnull().sum().sum() > 0:
          # obtain the name(s) of the columns with null values
          nan_columns = (
              X[self.variables_]
              .columns[X[self.variables_].isnull().any()]
              .tolist()
          )
  
          if len(nan_columns) > 1:
              nan_columns_str = ", ".join(nan_columns)
          else:
              nan_columns_str = nan_columns[0]
  
          if self.errors == "ignore":
              warnings.warn(
                  f"During the discretisation, NaN values were introduced in "
                  f"the feature(s) {nan_columns_str}."
              )
  
          elif self.errors == "raise":
              raise ValueError(
                  "During the discretisation, NaN values were introduced in "
                  f"the feature(s) {nan_columns_str}."
              )
  
      return X
  
file_path: feature_engine/feature_engine/discretisation/arbitrary.py
imports: import warnings
  from typing import Dict, List, Optional, Union
  import pandas
  from feature_engine._base_transformers.mixins import FitFromDictMixin
  from feature_engine._docstrings.fit_attributes import _feature_names_in_docstring, _n_features_in_docstring, _variables_attribute_docstring
  from feature_engine._docstrings.methods import _fit_not_learn_docstring, _fit_transform_docstring
  from feature_engine._docstrings.substitute import Substitution
  from feature_engine.discretisation.base_discretiser import BaseDiscretiser
  from feature_engine.tags import _return_tags
label_desc: Use image node_id 3 for calling the ArbitraryDiscretiser obj's underlying member method code with example usage: obj.transform(X) and returns: X