code: def split_one_field_into_many(
      df, field, splitter, filler, new_names_list
  ):
      """
      This little function takes any data frame field (string variables only) and splits
      it into as many fields as you want in the new_names_list.
      You can also specify what string to split on using the splitter argument.
      You can also fill Null values that occur due to your splitting by specifying a filler.
      if no new_names_list is given, then we use the name of the field itself to split.
      """
      import warnings
  
      warnings.filterwarnings("ignore")
      df = df.copy()
      ### First print the maximum number of things in that field
      max_things = df[field].map(lambda x: len(x.split(splitter))).max()
      if len(new_names_list) == 0:
          print(
              "    Max. columns created by splitting %s field is %d."
              % (field, max_things)
          )
      else:
          print(
              "    Max. columns created by splitting %s field is %d but you have given %d variable names only. Selecting first %d"
              % (
                  field,
                  max_things,
                  len(new_names_list),
                  len(new_names_list),
              )
          )
      ### This creates a new field that counts the number of things that are in that field.
      num_products_viewed = "count_things_in_" + field
      df[num_products_viewed] = (
          df[field].map(lambda x: len(x.split(";"))).values
      )
      ### Clean up the field such that it has the right number of split chars otherwise add to it
      df[field] = df[field].map(
          lambda x: x + splitter * (max_things - len(x.split(";")))
          if len(x.split(";")) < max_things
          else x
      )
      ###### Now you create new fields by split the one large field ########
      if new_names_list == "":
          new_names_list = [
              field + "_" + str(i) for i in range(1, max_things + 1)
          ]
      try:
          for i in range(len(new_names_list)):
              df[field].fillna(filler, inplace=True)
              df.loc[df[field] == splitter, field] = filler
              df[new_names_list[i]] = df[field].map(
                  lambda x: x.split(splitter)[i] if splitter in x else x
              )
      except:
          ### Check if the column is a string column. If not, give an error message.
          print(
              "Cannot split the column. Getting an error. Check the column again"
          )
          return df
      return df, new_names_list
  
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 4 for calling a global function with example usage: split_one_field_into_many(df, field, splitter, filler, new_names_list) and returns: df,  new_names_list, df