Olá pessoal,
Estou tendo o seguinte erro ao executar a seguinte linha de comando:
results.plot_diagnostics(figsize=(16,8))
plt.show()
Erro:
TypeError Traceback (most recent call last)
<ipython-input-34-6a31db76aed6> in <module>
----> 1 results.plot_diagnostics(figsize=(16,8))
2 plt.show()
C:\ProgramData\Anaconda3\lib\site-packages\statsmodels\tsa\statespace\mlemodel.py in plot_diagnostics(self, variable, lags, fig, figsize)
3900 else:
3901 x = np.arange(len(resid))
-> 3902 ax.plot(x, resid)
3903 ax.hlines(0, x[0], x[-1], alpha=0.5)
3904 ax.set_xlim(x[0], x[-1])
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes\_axes.py in plot(self, scalex, scaley, data, *args, **kwargs)
1665 lines = [*self._get_lines(*args, data=data, **kwargs)]
1666 for line in lines:
-> 1667 self.add_line(line)
1668 self.autoscale_view(scalex=scalex, scaley=scaley)
1669 return lines
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes\_base.py in add_line(self, line)
1900 line.set_clip_path(self.patch)
1901
-> 1902 self._update_line_limits(line)
1903 if not line.get_label():
1904 line.set_label('_line%d' % len(self.lines))
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\axes\_base.py in _update_line_limits(self, line)
1922 Figures out the data limit of the given line, updating self.dataLim.
1923 """
-> 1924 path = line.get_path()
1925 if path.vertices.size == 0:
1926 return
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\lines.py in get_path(self)
1025 """
1026 if self._invalidy or self._invalidx:
-> 1027 self.recache()
1028 return self._path
1029
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\lines.py in recache(self, always)
668 if always or self._invalidx:
669 xconv = self.convert_xunits(self._xorig)
--> 670 x = _to_unmasked_float_array(xconv).ravel()
671 else:
672 x = self._x
C:\ProgramData\Anaconda3\lib\site-packages\matplotlib\cbook\__init__.py in _to_unmasked_float_array(x)
1388 return np.ma.asarray(x, float).filled(np.nan)
1389 else:
-> 1390 return np.asarray(x, float)
1391
1392
TypeError: float() argument must be a string or a number, not 'Timestamp'
Obs.: Executei o código upado no Git e dá o mesmo erro. Estou usando o python 3.9.