# Buggy code
def _wrap_data(self, data, start_idx, end_idx, names=None):
    # TODO: check if this is reasonable for statespace
    # squeezing data: data may be:
    # - m x n: m dates, n simulations -> squeeze does nothing
    # - m x 1: m dates, 1 simulation -> squeeze removes last dimension
    # - 1 x n: don't squeeze, already fine
    # - 1 x 1: squeeze only second axis
    if data.ndim > 1 and data.shape[1] == 1:
        data = np.squeeze(data, axis=1)
    data = np.squeeze(data)
    if self.use_pandas:
        _, _, _, index = self._get_prediction_index(start_idx, end_idx)
        if data.ndim < 2:
            data = pd.Series(data, index=index, name=names)
        else:
            data = pd.DataFrame(data, index=index, columns=names)
    return data


# Traceback (TypeError)
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
%matplotlib inline
from statsmodels.tsa.exponential_smoothing.ets import ETSModel

austourists_data = [
30.05251300, 19.14849600, 25.31769200, 27.59143700,
32.07645600, 23.48796100, 28.47594000, 35.12375300,
36.83848500, 25.00701700, 30.72223000, 28.69375900,
36.64098600, 23.82460900, 29.31168300, 31.77030900,
35.17787700, 19.77524400, 29.60175000, 34.53884200,
41.27359900, 26.65586200, 28.27985900, 35.19115300,
42.20566386, 24.64917133, 32.66733514, 37.25735401,
45.24246027, 29.35048127, 36.34420728, 41.78208136,
49.27659843, 31.27540139, 37.85062549, 38.83704413,
51.23690034, 31.83855162, 41.32342126, 42.79900337,
55.70835836, 33.40714492, 42.31663797, 45.15712257,
59.57607996, 34.83733016, 44.84168072, 46.97124960,
60.01903094, 38.37117851, 46.97586413, 50.73379646,
61.64687319, 39.29956937, 52.67120908, 54.33231689,
66.83435838, 40.87118847, 51.82853579, 57.49190993,
65.25146985, 43.06120822, 54.76075713, 59.83447494,
73.25702747, 47.69662373, 61.09776802, 66.05576122,
]
austourists = pd.Series(austourists_data)

model = ETSModel(austourists, error="mul", trend="mul", seasonal="mul",seasonal_periods=12)
fit = model.fit()


pred = fit.get_prediction(start=len(austourists), end=len(austourists))
df = pred.summary_frame(alpha=0.05)

---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
30
31
---> 32 pred = fit.get_prediction(start=len(austourists), end=len(austourists))
33 df = pred.summary_frame(alpha=0.05)
34 df

5665     # GH#29069
5666     if not is_hashable(name):
-> 5667         raise TypeError(f"{cls.__name__}.name must be a hashable type")
5668
5669     return name

TypeError: Series.name must be a hashable type

# Fixed code
def _wrap_data(self, data, start_idx, end_idx, names=None):
    # TODO: check if this is reasonable for statespace
    # squeezing data: data may be:
    # - m x n: m dates, n simulations -> squeeze does nothing
    # - m x 1: m dates, 1 simulation -> squeeze removes last dimension
    # - 1 x n: don't squeeze, already fine
    # - 1 x 1: squeeze only second axis
    if data.ndim > 1 and data.shape[1] == 1:
        data = np.squeeze(data, axis=1)
    if self.use_pandas:
        _, _, _, index = self._get_prediction_index(start_idx, end_idx)
        if data.ndim < 2:
            data = pd.Series(data, index=index, name=names)
        else:
            data = pd.DataFrame(data, index=index, columns=names)
    return data