在此处输入代码this is the image of pip where I installed statsmodels
[这是我运行下面的代码时遇到的错误][2]
from statsmodels.tsa.seasonal import seasonal_decompose
from dateutil.parser import parse
df = pd.read_csv('https://raw.githubusercontent.com/selva86/datasets/master/a10.csv',parse_dates=['date'], index_col = 'date')
result_mul = seasonal_decompose(df['value'],model='multiplicative',extraplote_trend = 'freq')
result_add = seasonal_decompose(df['value'], model='additive',extrapolate_trend= 'freq')
plt.rcParams.update({'figure.figsize': (10,10)})
result_mul.plot().subtitle('Multiplicative Decompose', fontsize=22)
result_add.plot().subtitle('Additive Decompose', fontsize=22)
plt.show()
``
[2]:。我无法安装statsmodels模块,即使它已安装多次**
我认为您有0.11.1版本的statsmodels。但是,import statsmodels在我的Jupyter中使用statsmodels版本0.10.1,但请注意以下几点,并让我知道:
按照https://www.statsmodels.org/stable/importpaths.html中的建议,将statsmodels.api导入为sm
如果上述操作无效,请卸载statsmodels并使用以下命令重新安装:conda install-c anaconda statsmodels。建议在https://anaconda.org/anaconda/statsmodels中使用。在此之后,尝试导入
相关问题 更多 >
编程相关推荐