[英]TypeError: ufunc 'add' did not contain a loop with signature for ARIMA model
I trying to do ARIMA model analysis on a series extracted from the following pandas DataFrame 我试图对从以下熊猫DataFrame中提取的系列进行ARIMA模型分析
CpcGDP.tail()
65
2012-01-01 2593.23
2013-01-01 2591.06
2014-01-01 2608.38
2015-01-01 2665.35
2016-01-01 2724.4
I first convert objects 我先转换对象
CpcGDP.convert_objects(convert_numeric= True)
Then get the series and convert to float 然后得到系列并转换为浮点数
Cdx = CpcGDP.columns[0]
S = CpcGDP.loc[:, Cdx]
S.astype(float)
Then do the analysis 然后做分析
mod = sm.tsa.ARIMA(S.astype(float), order= (0,2,1))
result = mod.fit()
But I getthe following error 但是我得到以下错误
TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('<U21') dtype('<U21') dtype('<U21')
Can you help me solve this error, please? 您能帮我解决这个错误吗?
Had the same error doing the same stuff. 在执行相同的操作时发生了相同的错误。 For me the solution was using pandas
Series
instead of Dataframe
对我来说,解决方案是使用
Dataframe
Series
而不是Dataframe
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.