class_docstr: A ColumnSelector2D selects column in a sequence.
  
  It can be used to select:
  
  - a single column,
  - a range of columns,
  - a slice of columns,
  - a list of columns.
  
  The columns are expected to be integers.
  A special case is a string, which will be used as
  a pandas DataFrame column name.
class_docstr_tok: ["A","ColumnSelector2D","selects","column","in","a","sequence",".","It","can","be","used","to","select",":","-","a","single","column",",","-","a","range","of","columns",",","-","a","slice","of","columns",",","-","a","list","of","columns",".","The","columns","are","expected","to","be","integers",".","A","special","case","is","a","string",",","which","will","be","used","as","a","pandas","DataFrame","column","name","."]
code: def transform(self, data_inputs):
      dtype = type(data_inputs)
  
      if isinstance(self.columns_selection, slice):
          ret = list(
              map(itemgetter(self.columns_selection), data_inputs)
          )
      elif isinstance(self.columns_selection, list):
          if "DataFrame" in str(type(data_inputs)):
              ret = data_inputs.loc[:, self.columns_selection]
          else:
              columns = [
                  list(map(itemgetter(i), data_inputs))
                  for i in self.columns_selection
              ]
              ret = list(zip(*columns))
      elif isinstance(self.columns_selection, str):
          ret = data_inputs.loc[:, [self.columns_selection]].values
      elif self.columns_selection is None:
          ret = data_inputs
      else:
          raise ValueError(
              "column selection type not supported : {0}\nSupported types".format(
                  self.columns_selection, repr(ColumnSelectionType)
              )
          )
  
      if dtype == np.ndarray and not isinstance(ret, np.ndarray):
          return np.array(ret)
      return ret
  
imports: from operator import itemgetter
  from typing import List, Tuple, Union, Iterable
  import numpy
  from neuraxle.base import MetaStep, BaseTransformer
  from neuraxle.pipeline import Pipeline
  from neuraxle.steps.loop import ForEach
  from neuraxle.union import FeatureUnion
label_desc: Use image node_id 2 for calling the ColumnSelector2D obj's underlying member method code with example usage: obj.transform(data_inputs) and returns: ret, np