class_docstr: Encodes missing values for both numerical and categorical features.
  
  Several strategies are possible in each case.
  
  Parameters
  ----------
  numerical_strategy : str or float or int. default = "mean"
      The strategy to encode NA for numerical features.
      Available strategies = "mean", "median",
      "most_frequent" or a float/int value
  
  categorical_strategy : str, default = '<NULL>'
      The strategy to encode NA for categorical features.
      Available strategies = a string or "most_frequent"
docstr: Transform the dataset.
  
  Parameters
  ----------
  df : pandas.Dataframe of shape = (n, n_features)
      The dataset with numerical and categorical features.
  
  Returns
  -------
  pandas.Dataframe of shape = (n, n_features)
      The dataset with no missing values.
code: def transform(self, df):
      """Transform the dataset.
  
      Parameters
      ----------
      df : pandas.Dataframe of shape = (n, n_features)
          The dataset with numerical and categorical features.
  
      Returns
      -------
      pandas.Dataframe of shape = (n, n_features)
          The dataset with no missing values.
  
      """
      if self.__fitOK:
          if len(self.__Lnum) == 0:
              if self.categorical_strategy != "most_frequent":
                  return df[self.__Lcat].fillna(
                      self.categorical_strategy
                  )
  
              else:
                  return df[self.__Lcat].fillna(self.__mode)
  
          else:
              if self.numerical_strategy in [
                  "mean",
                  "median",
                  "most_frequent",
              ]:
                  if len(self.__Lcat) != 0:
                      if self.categorical_strategy != "most_frequent":
                          return pd.concat(
                              (
                                  pd.DataFrame(
                                      self.__imp.transform(
                                          df[self.__Lnum]
                                      ),
                                      columns=self.__Lnum,
                                      index=df.index,
                                  ),
                                  df[self.__Lcat].fillna(
                                      self.categorical_strategy
                                  ),
                              ),
                              axis=1,
                          )[df.columns]
  
                      else:
                          return pd.concat(
                              (
                                  pd.DataFrame(
                                      self.__imp.transform(
                                          df[self.__Lnum]
                                      ),
                                      columns=self.__Lnum,
                                      index=df.index,
                                  ),
                                  df[self.__Lcat].fillna(self.__mode),
                              ),
                              axis=1,
                          )[df.columns]
  
                  else:
                      return pd.DataFrame(
                          self.__imp.transform(df[self.__Lnum]),
                          columns=self.__Lnum,
                          index=df.index,
                      )
  
              elif (type(self.numerical_strategy) == int) | (
                  type(self.numerical_strategy) == float
              ):
                  if len(self.__Lcat) != 0:
                      if self.categorical_strategy != "most_frequent":
                          return pd.concat(
                              (
                                  df[self.__Lnum].fillna(
                                      self.numerical_strategy
                                  ),
                                  df[self.__Lcat].fillna(
                                      self.categorical_strategy
                                  ),
                              ),
                              axis=1,
                          )[df.columns]
  
                      else:
                          return pd.concat(
                              (
                                  df[self.__Lnum].fillna(
                                      self.numerical_strategy
                                  ),
                                  df[self.__Lcat].fillna(self.__mode),
                              ),
                              axis=1,
                          )[df.columns]
                  else:
                      return df[self.__Lnum].fillna(
                          self.numerical_strategy
                      )
  
      else:
          raise ValueError("Call fit or fit_transform function before")
  
file_path: MLBox/mlbox/encoding/na_encoder.py
imports: import pandas
  import warnings
  from sklearn.impute import SimpleImputer
label_desc: Use image node_id 6 for calling the NA_encoder obj's underlying member method code with example usage: obj.transform(df) and returns: df, df, pd, pd, pd, df, pd, pd