gpt4 book ai didi

python-3.x - statsmodels.formula.api 导入错误 : cannot import name 'TimeSeries'

转载 作者:行者123 更新时间:2023-12-04 13:13:01 24 4
gpt4 key购买 nike

这里是python的新手。

使用以下内容:
python - v1.3.1
Spyder - v3.1.4
Python - v3.5

我正在尝试导入以下库:

import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import statsmodels.formula.api as sm

它不断给我以下错误:
import statsmodels.formula.api as sm
Traceback (most recent call last):

File "<ipython-input-2-2515cefb61aa>", line 1, in <module>
import statsmodels.formula.api as sm

File "//anaconda/lib/python3.5/site-packages/statsmodels/formula/api.py", line 1, in <module>
from statsmodels.regression.linear_model import GLS

File "//anaconda/lib/python3.5/site-packages/statsmodels/regression/__init__.py", line 1, in <module>
from .linear_model import yule_walker

File "//anaconda/lib/python3.5/site-packages/statsmodels/regression/linear_model.py", line 52, in <module>
import statsmodels.base.model as base

File "//anaconda/lib/python3.5/site-packages/statsmodels/base/model.py", line 5, in <module>
from statsmodels.base.data import handle_data

File "//anaconda/lib/python3.5/site-packages/statsmodels/base/data.py", line 8, in <module>
from pandas import DataFrame, Series, TimeSeries, isnull

ImportError: cannot import name 'TimeSeries'

我读了一些关于更新 Pandas 的帖子。我试过了,但它不起作用。关于错误和解决方案的任何想法? (当我只导入 statsmodel.formula 或只导入 statsmodel 时它工作正常)

最佳答案

升级 statsmodels 对我有用,
pip install statsmodels --upgrade

关于python-3.x - statsmodels.formula.api 导入错误 : cannot import name 'TimeSeries' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44312907/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com