ValueError from statsmodels ExponentialSmoothing I've been having a frustrating issue with the ExponentialSmoothing module from statsmodels.

My data is a pandas series with 74 weekly data points that looks like this:

2017-12-31    6069
2018-01-07    8143
2018-01-14    6740
2018-01-21    6433
2018-01-28    6631
2018-02-04    6308
2018-02-11    5536
2018-02-18    6025
2018-02-25    5171
...           ...


When I call the following functions:

model = ExponentialSmoothing(data, trend='add',damped=True,seasonal='mul',seasonal_periods=52)
model_fit = model.fit()


I get:

Traceback (most recent call last):
  File ".\smoothingjuly.py", line 24, in &lt;module&gt;
    model_fit = model.fit()
  File "C:\Users\lhughes\AppData\Local\Programs\Python\Python37\lib\site-packages\statsmodels\tsa\holtwinters.py", line 641, in fit
    l0, b0, s0 = self.initial_values()
  File "C:\Users\lhughes\AppData\Local\Programs\Python\Python37\lib\site-packages\statsmodels\tsa\holtwinters.py", line 773, in initial_values
    b0 = ((lead - lag) / m).mean()
ValueError: operands could not be broadcast together with shapes (22,) (52,)


Why is this? It works if I decrease the number of seasonal periods, but that makes my model useless. Is 74 data points not enough for the model? If so what is the minimum?

Thanks
The error is raised from lead - lag; in initial_values, these are set as y[m:2m] and y[:m] respectively,  where m is the seasonality length (52 in your case). So lead is only getting 22 values, and hence the size mismatch complaint.
So yes, for this to work directly, you'd need at least 104 datapoints.  See the source, and docpage.
(N.B.  This is for version 0.10.  Some changes have been made in v0.12, in which the initialization takes more options.  But OP's context is version-specific, so I'll leave it at that.)
But, you can bypass this bit of the code by passing your own initial_slope to fit*.  I might suggest mimicking statsmodels's approach, but limiting the year-over-year slopes to the range you have available: (y[52:74] - y[:22]).mean() / 52
* this is one change in v0.12; these parameters are passed on model instantiation, not fit.  See the docs if you want to do this in a newer version.