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_dates(self, result):
      squeezed = result.squeeze()
      k_endog = np.array(self.ynames, ndmin=1).shape[0]
      if k_endog > 1 and squeezed.shape == (k_endog,):
          squeezed = np.asarray(squeezed)[None, :]
      # May be zero-dim, for example in the case of forecast one step in tsa
      if squeezed.ndim < 2:
          return Series(squeezed, index=self.predict_dates)
      else:
          return DataFrame(
              np.asarray(result),
              index=self.predict_dates,
              columns=self.ynames,
          )
  
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 13 for calling the PandasData obj's underlying member method code with example usage: obj.attach_dates(result) and returns: Series, DataFrame