code: def feature_engineering(df, ft_requests, idcol):
      """
      The Feature Engineering module needs FeatureTools installed to work.
      So please do "pip install featuretools" before trying out this module.
      It takes a given data set, df and adds features based on the requet types in
      ft_requests which can be 'add','subtract','multiply','divide'. If you have
      an id_column in the data set, you can provide it as idcol (a string variable).
      It will return your modified dataset with 'idcol' as the index. Make sure
      you reset the index if you want to return it to its former state.
      Also do not send in your entire dataframe! Just send a small dataframe with a few variables.
      Once you see how it adds to performance of model, you can add more variables to dataframe.
      """
      df = copy.deepcopy(df)
      if df.shape[1] < 2:
          print(
              "More than one column in dataframe required to perform feature engineering. Returning"
          )
          return df
      ft_dict = dict(
          zip(
              ["add", "multiply", "subtract", "divide"],
              [
                  "add_numeric",
                  "multiply_numeric",
                  "subtract_numeric",
                  "divide_numeric",
              ],
          )
      )
      if len(ft_requests) > 0:
          ft_list = []
          for ft_one in ft_requests:
              if ft_one in ft_dict.keys():
                  ft_list.append(ft_dict[ft_one])
              else:
                  print(
                      "    Cannot perform %s-type feature engineering..."
                      % ft_one
                  )
          cols = [x for x in df.columns.tolist() if x not in [idcol]]
          for each_ft, count in zip(ft_list, range(len(ft_list))):
              if count == 0:
                  df_mod = add_computational_primitive_features(
                      df, [each_ft], idcol
                  )
                  print(df_mod.shape)
              else:
                  df_temp = add_computational_primitive_features(
                      df, [each_ft], idcol
                  )
                  df_temp.drop(cols, axis=1, inplace=True)
                  df_mod = pd.concat(
                      [df_mod, df_temp], axis=1, ignore_index=False
                  )
                  print(df_mod.shape)
      else:
          df_mod = add_computational_primitive_features(df, [], idcol)
      return df_mod
  
file_path: Auto_ViML/autoviml/feature_engineering.py
imports: import pandas
  import numpy
  import copy
  import time
  import pdb
label_desc: Use image node_id 2 for calling a global function with example usage: feature_engineering(df, ft_requests, idcol) and returns: df_mod, df