class_docstr: The LogTransformer() applies the natural logarithm or the base 10 logarithm to
  numerical variables. The natural logarithm is the logarithm in base e.
  
  The LogTransformer() only works with positive values. If the variable
  contains a zero or a negative value the transformer will return an error.
  
  A list of variables can be passed as an argument. Alternatively, the transformer
  will automatically select and transform all variables of type numeric.
  
  More details in the :ref:`User Guide <log_transformer>`.
  
  Parameters
  ----------
  {variables}
  
  base: string, default='e'
      Indicates if the natural or base 10 logarithm should be applied. Can take
      values 'e' or '10'.
  
  Attributes
  ----------
  {variables_}
  
  {feature_names_in_}
  
  {n_features_in_}
  
  Methods
  -------
  {fit}
  
  {fit_transform}
  
  {inverse_transform}
  
  transform:
      Transform the variables using the logarithm.
docstr: Transform the variables with the logarithm.
  
  Parameters
  ----------
  X: Pandas DataFrame of shape = [n_samples, n_features]
      The data to be transformed.
  
  Returns
  -------
  X_new: pandas dataframe
      The dataframe with the transformed variables.
docstr_tok: ["Transform","the","variables","with","the","logarithm",".","Parameters","--","--","--","--","--","X",":","Pandas","DataFrame","of","shape","=","[","n_samples",",","n_features","]","The","data","to","be","transformed",".","Returns","--","--","--","-","X_new",":","pandas","dataframe","The","dataframe","with","the","transformed","variables","."]
code: def transform(self, X: pd.DataFrame) -> pd.DataFrame:
      """
      Transform the variables with the logarithm.
  
      Parameters
      ----------
      X: Pandas DataFrame of shape = [n_samples, n_features]
          The data to be transformed.
  
      Returns
      -------
      X_new: pandas dataframe
          The dataframe with the transformed variables.
      """
  
      # check input dataframe and if class was fitted
      X = super().transform(X)
  
      # check contains zero or negative values
      if (X[self.variables_] <= 0).any().any():
          raise ValueError(
              "Some variables contain zero or negative values, can't apply log"
          )
  
      # transform
      if self.base == "e":
          X.loc[:, self.variables_] = np.log(X.loc[:, self.variables_])
      elif self.base == "10":
          X.loc[:, self.variables_] = np.log10(
              X.loc[:, self.variables_]
          )
  
      return X
  
imports: from typing import Dict, List, Optional, Union
  import numpy
  import pandas
  from feature_engine._base_transformers.base_numerical import BaseNumericalTransformer
  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.init_parameters import _variables_numerical_docstring
  from feature_engine._docstrings.methods import _fit_not_learn_docstring, _fit_transform_docstring, _inverse_transform_docstring
  from feature_engine._docstrings.substitute import Substitution
  from feature_engine._variable_handling.init_parameter_checks import _check_init_parameter_variables
  from feature_engine.tags import _return_tags
label_desc: Use image node_id 3 for calling the LogTransformer obj's underlying member method code with example usage: obj.transform(X) and returns: X