我现在遇到这个问题,我无法从 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/