class_docstr: Data handling class which knows how to reattach pandas metadata to model
  results
class_docstr_tok: ["Data","handling","class","which","knows","how","to","reattach","pandas","metadata","to","model","results"]
code: def attach_columns(self, result):
      # this can either be a 1d array or a scalar
      # do not squeeze because it might be a 2d row array
      # if it needs a squeeze, the bug is elsewhere
      if result.ndim <= 1:
          return Series(result, index=self.param_names)
      else:  # for e.g., confidence intervals
          return DataFrame(result, index=self.param_names)
  
imports: from __future__ import annotations
  from statsmodels.compat.python import lmap
  from functools import reduce
  import numpy
  from pandas import DataFrame, Series, isnull, MultiIndex
  import statsmodels.tools.data
  from statsmodels.tools.decorators import cache_readonly, cache_writable
  from statsmodels.tools.sm_exceptions import MissingDataError
label_desc: Use image node_id 8 for calling the PandasData obj's underlying member method code with example usage: obj.attach_columns(result) and returns: Series, DataFrame