code: def table_apply(table, func, subset=None):
      
      from . import Table
      df = table.to_df()
  
      if subset is not None:
          # Iterate through columns
          subset = np.atleast_1d(subset)
          if any([i not in df.columns for i in subset]):
              err = np.where([i not in df.columns for i in subset])[0]
              err = "Column mismatch: {0}".format(
                  [subset[i] for i in err])
              raise ValueError(err)
          for col in subset:
              df[col] = df[col].apply(func)
      else:
          df = df.apply(func)
      if isinstance(df, pd.Series):
          # Reshape it so that we can easily convert back
          df = pd.DataFrame(df).T
      tab = Table.from_df(df)
      return tab
docs: Applies a function to each column and returns a Table.
  
      Uses pandas `apply` under the hood, then converts back to a Table
  
      Args:
          table : instance of Table
              The table to apply your function to
          func : function
              Any function that will work with DataFrame.apply
          subset : list | None
              A list of columns to apply the function to. If None, function
              will be applied to all columns in table
  
      Returns
      -------
      tab : instance of Table
          A table with the given function applied. It will either be the
          shape == shape(table), or shape (1, table.shape[1])