docstr: Apply function to each column, by group
          
docstr_tok: ["Apply","function","to","each","column",",","by","group"]
code: def transform_array(self, array, function, level=0, **kwargs):
      """Apply function to each column, by group"""
      if array.shape[0] != self.nobs:
          raise Exception("array does not have the same shape as index")
      dataframe = pd.DataFrame(array, index=self.index)
      return self.transform_dataframe(
          dataframe, function, level=level, **kwargs
      )
  
imports: from statsmodels.compat.python import lrange, lzip
  import numpy
  import pandas
  import statsmodels.tools.data
  from pandas import Index, MultiIndex
label_desc: Use image node_id 12 for calling the Grouping obj's underlying member method code with example usage: obj.transform_array(array, function, level) and returns: self