jupyter-notebook - 导入错误: cannot import name 'STL' from 'statsmodels.tsa.seasonal'

标签 jupyter-notebook statsmodels loess

我现在遇到这个问题,我无法从 statsmodels 导入 STL。我尝试卸载 statsmodels,因为在有类似问题的地方推荐它,但这是不可能的,至少是我这样做的方式: !pip uninstall statsmodels - 不起作用。

最佳答案

statsmodels 中的 STL 函数似乎未包含在该库的最新稳定版本 (0.10.2) 中,但包含在开发版本 (0.11.0dev0) 中。

您可以使用以下命令构建并安装此特定版本:pip install git+https://github.com/statsmodels/statsmodels.git

为此,如果您还没有 C 编译器,您可能需要一个 C 编译器,这里有所有解释:https://www.statsmodels.org/dev/install.html#installation-from-source

我还发现这个包看起来很有前途:https://github.com/jrmontag/STLDecompose

关于jupyter-notebook - 导入错误: cannot import name 'STL' from 'statsmodels.tsa.seasonal' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58928785/

相关文章:

Python 错误 : len() of unsized object while using statsmodels with one row of data

Python 与 MATLAB : ARIMA Model with Known Parameter Values

r - 黄土拟合和结果方程

python - 将回归线添加到 shap.dependence_plot

python - 如何在 Jupyter 笔记本中获得交互式 Bokeh

python - Pandas 根据均值构建子表

python - 聚类重叠椭圆

python - Jupyter 实验室中的后台线程时钟

python - 如何在 Pandas 中生成多个交互项?

python - Python中LOWESS的置信区间