gpt4 book ai didi

python-2.7 - pandas ols 导入损坏?

转载 作者:行者123 更新时间:2023-12-02 18:48:31 26 4
gpt4 key购买 nike

我尝试在 pandas 0.9.1 中执行 OLS,但出现此错误:

ipdb> foo = ols(y=df[y_var[1]], x=df[x_var], pool=False )
*** ImportError: No module named scikits.statsmodels.api

我猜错误来自ols.py:

try:
import statsmodels.api as sm
except ImportError:
import scikits.statsmodels.api as sm

这是否意味着我错误地安装了pandas?

最佳答案

@TomAugspurger 来救援:

statsmodels is a separate package that is an optional dependency for pandas. You'll need to install statsmodels to do OLS. Try pip install statsmodels. You'll probably want to install the development build. I think they're close to releasing a new version so it should be very stable. – TomAugspurger 2 hours

关于python-2.7 - pandas ols 导入损坏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17836137/

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