import statsmodels.formula.api --> ImportError: cannot import name 'getargspec'

原始代码: import statsmodels.formula.api as smf from statsmodels.stats.anova import anova_lm factors = '+'.join(factor) formula = 'SalePrice ~ %s' % factors mod = smf.ols(formula,df_train) anova_results = anova_lm(mod.fit()) print(anova_results.sort_values(by='PR(>F)')) 错误提示: D:\Users\wangqingquan\Anaconda3\lib\site-packages\statsmodels\formula\api.py in () ----> 1 from statsmodels.regression.linear_model import GLS 2 gls = GLS.from_formula 3 from statsmodels.regression.linear_model import WLS 4 wls = WLS.from_formula 5 from statsmodels.regression.linear_model import OLS D:\Users\wangqingquan\Anaconda3\lib\site-packages\statsmodels\regression\__init__.py in () ----> 1 from .linear_model import yule_walker 2 3 from statsmodels import NoseWrapper as Tester 4 test = Tester().test D:\Users\wangqingquan\Anaconda3\lib\site-packages\statsmodels\regression\linear_model.py in () 51 cache_readonly, 52 cache_writable) ---> 53 import statsmodels.base.model as base 54 import statsmodels.base.wrapper as wrap 55 from statsmodels.emplike.elregress import _ELRegOpts D:\Users\wangqingquan\Anaconda3\lib\site-packages\statsmodels\base\model.py in () 8 from statsmodels.stats.contrast import ContrastResults, WaldTestResults 9 from statsmodels.tools.decorators import resettable_cache, cache_readonly ---> 10 import statsmodels.base.wrapper as wrap 11 from statsmodels.tools.numdiff import approx_fprime 12 from statsmodels.tools.sm_exceptions import ValueWarning, \ D:\Users\wangqingquan\Anaconda3\lib\site-packages\statsmodels\base\wrapper.py in () 3 4 import numpy as np ----> 5 from statsmodels.compat.python import get_function_name, iteritems, getargspec 6 7 class ResultsWrapper(object): ImportError: cannot import name 'getargspec'

蓝田孤玉

赞同来自:

python 3.6.0

fish - Hadooper

赞同来自:

这是什么课程的问题?

要回复问题请先登录注册