class_docstr: DropConstantFeatures() drops constant and quasi-constant variables from a dataframe.
  Constant variables show the same value in all the observations in the dataset.
  Quasi-constant variables show the same value in almost all the observations in the
  dataset.
  
  This transformer works with numerical and categorical variables. The user can
  indicate a list of variables to examine. Alternatively, the transformer will
  evaluate all the variables in the dataset.
  
  The transformer will first identify and store the constant and quasi-constant
  variables. Next, the transformer will drop these variables from a dataframe.
  
  More details in the :ref:`User Guide <drop_constant>`.
  
  Parameters
  ----------
  {variables}
  
  tol: float,int,  default=1
      Threshold to detect constant/quasi-constant features. Variables showing the
      same value in a percentage of observations greater than tol will be considered
      constant / quasi-constant and dropped. If tol=1, the transformer removes
      constant variables. Else, it will remove quasi-constant variables. For example,
      if tol=0.98, the transformer will remove variables that show the same value in
      98% of the observations.
  
  missing_values: str, default=raises
      Whether the missing values should be raised as error, ignored or included as an
      additional value of the variable. Takes values 'raise', 'ignore', 'include'.
  
  {confirm_variables}
  
  Attributes
  ----------
  features_to_drop_:
      List with constant and quasi-constant features.
  
  {variables_}:
  
  {feature_names_in_}
  
  {n_features_in_}
  
  Methods
  -------
  fit:
      Find constant and quasi-constant features.
  
  {fit_transform}
  
  {get_support}
  
  transform:
      Remove constant and quasi-constant features.
  
  Notes
  -----
  This transformer is a similar concept to the VarianceThreshold from Scikit-learn,
  but it evaluates number of unique values instead of variance.
  
  See Also
  --------
  sklearn.feature_selection.VarianceThreshold
docstr: Find constant and quasi-constant features.
  
  Parameters
  ----------
  X: pandas dataframe of shape = [n_samples, n_features]
      The input dataframe.
  y: None
      y is not needed for this transformer. You can pass y or None.
docstr_tok: ["Find","constant","and","quasi-constant","features",".","Parameters","--","--","--","--","--","X",":","pandas","dataframe","of","shape","=","[","n_samples",",","n_features","]","The","input","dataframe",".","y",":","None","y","is","not","needed","for","this","transformer",".","You","can","pass","y","or","None","."]
code: def fit(self, X: pd.DataFrame, y: pd.Series = None):
      """
      Find constant and quasi-constant features.
  
      Parameters
      ----------
      X: pandas dataframe of shape = [n_samples, n_features]
          The input dataframe.
      y: None
          y is not needed for this transformer. You can pass y or None.
      """
  
      # check input dataframe
      X = check_X(X)
  
      # If required exclude variables that are not in the input dataframe
      self._confirm_variables(X)
  
      # find all variables or check those entered are present in the dataframe
      self.variables_ = _find_all_variables(X, self.variables_)
  
      if self.missing_values == "raise":
          # check if dataset contains na
          _check_contains_na(X, self.variables_)
  
      if self.missing_values == "include":
          X[self.variables_] = X[self.variables_].fillna(
              "missing_values"
          )
  
      # find constant features
      if self.tol == 1:
          self.features_to_drop_ = [
              feature
              for feature in self.variables_
              if X[feature].nunique() == 1
          ]
  
      # find constant and quasi-constant features
      else:
          self.features_to_drop_ = []
  
          for feature in self.variables_:
              # find most frequent value / category in the variable
              predominant = (
                  (X[feature].value_counts() / float(len(X)))
                  .sort_values(ascending=False)
                  .values[0]
              )
  
              if predominant >= self.tol:
                  self.features_to_drop_.append(feature)
  
      # check we are not dropping all the columns in the df
      if len(self.features_to_drop_) == len(X.columns):
          raise ValueError(
              "The resulting dataframe will have no columns after dropping all "
              "constant or quasi-constant features. Try changing the tol value."
          )
  
      # save input features
      self._get_feature_names_in(X)
  
      return self
  
file_path: feature_engine/feature_engine/selection/drop_constant_features.py
imports: from typing import List, Union
  import pandas
  from feature_engine._docstrings.fit_attributes import _feature_names_in_docstring, _n_features_in_docstring
  from feature_engine._docstrings.methods import _fit_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._variable_handling.variable_type_selection import _find_all_variables
  from feature_engine.dataframe_checks import _check_contains_na, check_X
  from feature_engine.selection._docstring import _get_support_docstring, _variables_all_docstring, _variables_attribute_docstring
  from feature_engine.selection.base_selector import BaseSelector
  from feature_engine.tags import _return_tags
label_desc: Use image node_id 2 for calling the DropConstantFeatures obj's underlying member method code with example usage: obj.fit(X, y) and returns: self