Repository: statsmodels/statsmodels

Issue:
ETSModel get_prediction throws TypeError: Series.name must be a hashable type forecasting single timestamp
#### Describe the bug

If you try to predict outsample and get prediction intervals for a single timestamp with get_prediction function using an ETS model, you get an error TypeError: Series.name must be a hashable type. To get a single step forecast, the table has to have a single index, to achieve that start and end index has to be the same. This is causing the issue. 

#### Code Sample, a copy-pastable example if possible

```python
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

```
<details>

**Note**: As you can see, there are many issues on our GitHub tracker, so it is very possible that your issue has been posted before. Please check first before submitting so that we do not have to handle and close duplicates.

**Note**: Please be sure you are using the latest released version of `statsmodels`, or a recent build of `master`. If your problem has been fixed in an unreleased version, you might be able to use `master` until a new release occurs. 

**Note**: If you are using a released version, have you verified that the bug exists in the master branch of this repository? It helps the limited resources if we know problems exist in the current master so that they do not need to check whether the code sample produces a bug in the next release.

</details>


If the issue has not been resolved, please file it in the issue tracker.

#### Expected Output

Single step forecast and forecast intervals

#### Output of ``import statsmodels.api as sm; sm.show_versions()``

<details>

INSTALLED VERSIONS
------------------
Python: 3.8.5.final.0
OS: Darwin 19.6.0 Darwin Kernel Version 19.6.0: Mon Aug 31 22:12:52 PDT 2020; root:xnu-6153.141.2~1/RELEASE_X86_64 x86_64
byteorder: little
LC_ALL: None
LANG: en_GB.UTF-8

statsmodels
===========

Installed: 0.12.1 (/usr/local/lib/python3.8/site-packages/statsmodels)

Required Dependencies
=====================

cython: 0.29.17 (/usr/local/lib/python3.8/site-packages/Cython)
numpy: 1.18.5 (/usr/local/lib/python3.8/site-packages/numpy)
scipy: 1.4.1 (/usr/local/lib/python3.8/site-packages/scipy)
pandas: 1.1.4 (/usr/local/lib/python3.8/site-packages/pandas)
    dateutil: 2.8.1 (/usr/local/lib/python3.8/site-packages/dateutil)
patsy: 0.5.1 (/usr/local/lib/python3.8/site-packages/patsy)

Optional Dependencies
=====================

matplotlib: 3.3.1 (/usr/local/lib/python3.8/site-packages/matplotlib)
    backend: MacOSX 
cvxopt: Not installed
joblib: 0.16.0 (/usr/local/lib/python3.8/site-packages/joblib)

Developer Tools
================

IPython: 7.19.0 (/Users/kutaykoralturk/Library/Python/3.8/lib/python/site-packages/IPython)
    jinja2: 2.11.2 (/usr/local/lib/python3.8/site-packages/jinja2)
sphinx: 3.2.1 (/usr/local/lib/python3.8/site-packages/sphinx)
    pygments: 2.7.2 (/usr/local/lib/python3.8/site-packages/pygments)
pytest: 6.1.2 (/usr/local/lib/python3.8/site-packages/pytest)
virtualenv: Not installed

</details>



Discussion:
Thanks very much for reporting this!

Resolving patch:
diff --git a/statsmodels/tsa/exponential_smoothing/base.py b/statsmodels/tsa/exponential_smoothing/base.py
--- a/statsmodels/tsa/exponential_smoothing/base.py
+++ b/statsmodels/tsa/exponential_smoothing/base.py
@@ -205,7 +205,6 @@ def _wrap_data(self, data, start_idx, end_idx, names=None):
         # - 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:


Test patch:
diff --git a/statsmodels/tsa/tests/test_exponential_smoothing.py b/statsmodels/tsa/tests/test_exponential_smoothing.py
--- a/statsmodels/tsa/tests/test_exponential_smoothing.py
+++ b/statsmodels/tsa/tests/test_exponential_smoothing.py
@@ -1005,3 +1005,28 @@ def __init__(self, short_name):
     fit.model = DummyModel("AAA")
     s_AAA = fit._relative_forecast_variance(steps)
     assert_almost_equal(s_AAdA, s_AAA, 2)
+
+
+def test_one_step_ahead(setup_model):
+    model, params, results_R = setup_model
+    model2 = ETSModel(
+        pd.Series(model.endog),
+        seasonal_periods=model.seasonal_periods,
+        error=model.error,
+        trend=model.trend,
+        seasonal=model.seasonal,
+        damped_trend=model.damped_trend,
+    )
+    res = model2.smooth(params)
+
+    fcast1 = res.forecast(steps=1)
+    fcast2 = res.forecast(steps=2)
+    assert_allclose(fcast1.iloc[0], fcast2.iloc[0])
+
+    pred1 = res.get_prediction(start=model2.nobs, end=model2.nobs,
+                               simulate_repetitions=2)
+    pred2 = res.get_prediction(start=model2.nobs, end=model2.nobs + 1,
+                               simulate_repetitions=2)
+    df1 = pred1.summary_frame(alpha=0.05)
+    df2 = pred1.summary_frame(alpha=0.05)
+    assert_allclose(df1.iloc[0, 0], df2.iloc[0, 0])