简体   繁体   English

TypeError:ufunc'add'不包含带有ARIMA模型签名的循环

[英]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

TypeError: ufunc 'add' 不包含签名匹配类型 dtype(' <u1') dtype('<u1') dtype('<u1')< div><div id="text_translate"><p> 我是 Python 用户的初学者。 当我尝试在下面编写代码时发生错误</p><pre>import numpy as np np.array(['a', 'b', 'c']) + np.array(['d','e', 'f'])</pre><pre> TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('&lt;U1') dtype('&lt;U1') dtype('&lt;U1')</pre><p> 所以我尝试设置dtype = '&lt;U1' ,但它没有用</p><pre>import numpy as np np.array(['a', 'b', 'c'], dtype='&lt;U1') + np.array(['d','e', 'f'], dtype='&lt;U1')</pre><p> 如何无错误地连接那些 np.arrays ?</p></div></u1')> - TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('<U1') dtype('<U1') dtype('<U1')

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 类型错误:ufunc &#39;add&#39; 不包含具有签名匹配类型的循环 - TypeError: ufunc 'add' did not contain a loop with signature matching types ufunc &#39;add&#39; 不包含签名匹配类型 dtype 的循环 - ufunc 'add' did not contain a loop with signature matching types dtype TypeError: ufunc 'add' 不包含签名匹配类型 dtype(' <u1') dtype('<u1') dtype('<u1')< div><div id="text_translate"><p> 我是 Python 用户的初学者。 当我尝试在下面编写代码时发生错误</p><pre>import numpy as np np.array(['a', 'b', 'c']) + np.array(['d','e', 'f'])</pre><pre> TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('&lt;U1') dtype('&lt;U1') dtype('&lt;U1')</pre><p> 所以我尝试设置dtype = '&lt;U1' ,但它没有用</p><pre>import numpy as np np.array(['a', 'b', 'c'], dtype='&lt;U1') + np.array(['d','e', 'f'], dtype='&lt;U1')</pre><p> 如何无错误地连接那些 np.arrays ?</p></div></u1')> - TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('<U1') dtype('<U1') dtype('<U1') Numpy polyfit ufunc中的Python TypeError不包含具有匹配签名类型的循环 - Python TypeError in Numpy polyfit ufunc did not contain loop with matching signature types UFuncTypeError:在列表中添加元素时,ufunc&#39;add&#39;不包含具有签名匹配类型的循环 - UFuncTypeError: ufunc 'add' did not contain a loop with signature matching types when add element in list 附加字符串并添加到 dataframe 列发生“ufunc'add'没有包含签名匹配类型的循环”-错误 - Appending strings and adding to dataframe column occurs “ufunc 'add' did not contain a loop with signature matching types”-error numpy.core._exceptions.UFuncTypeError: ufunc &#39;add&#39; 不包含带有签名匹配的循环 - numpy.core._exceptions.UFuncTypeError: ufunc 'add' did not contain a loop with signature matching TypeError:ufunc&#39;add&#39;不包含签名匹配类型为dtype(&#39;的循环 - TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('<U72') dtype('<U72') dtype('<U72') Keras PREDICTION抛出&#39;TypeError:ufunc&#39;add&#39;不包含签名匹配类型为dtype(&#39;的循环 - Keras PREDICTION throws 'TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('<U4') dtype('<U4') dtype('<U4')' 类型错误:ufunc &#39;add&#39; 不包含签名匹配类型 dtype(&#39;S23&#39;) dtype(&#39;S23&#39;) dtype(&#39;S23&#39;) 的循环 - TypeError: ufunc 'add' did not contain a loop with signature matching types dtype('S23') dtype('S23') dtype('S23')
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM