code: def _wrap_func(func, func_name):
      def f(self, *args, **kwargs):
          from pandas_ml.core.frame import ModelFrame
  
          if isinstance(self._df, ModelFrame):
              values = self._data.values
  
              if is_integer_dtype(values):
                  # integer raises an error in normalize
                  values = values.astype(np.float)
  
              result = func(values, *args, **kwargs)
              result = self._constructor(
                  result,
                  index=self._data.index,
                  columns=self._data.columns,
              )
          else:
              # ModelSeries
              values = np.atleast_2d(self._df.values)
              if is_integer_dtype(values):
                  values = values.astype(np.float)
  
              result = func(values, *args, **kwargs)
              result = self._constructor(
                  result[0], index=self._df.index, name=self._df.name
              )
          return result
  
      f.__doc__ = (
          """
          Call ``%s`` using automatic mapping.
  
          - ``X``: ``ModelFrame.data``
          """
          % func_name
      )
      return f
  
file_path: pandas-ml/pandas_ml/skaccessors/preprocessing.py
imports: import numpy
  from pandas_ml.core.accessor import _AccessorMethods, _attach_methods
  from pandas_ml.compat import _SKLEARN_INSTALLED, is_integer_dtype
label_desc: Use image node_id 1 for calling a global function with example usage: _wrap_func(func, func_name) and returns: f, result