AttributeErrorTraceback (most recent call last)
< ipython-input-18-9fe3c31d8033> in < module>()
----> 1 COUNT(CLOSE,5)
< ipython-input-15-b77019994e5d> in COUNT(S, N)
1 def COUNT(S, N): # COUNT(CLOSE>O, N): 最近N天满足S_BOO的天数 True的天数
----> 2 return SUM(S,N)
< ipython-input-17-ecbd149d653f> in SUM(S, N)
1 def SUM(S, N): #对序列求N天累计和,返回序列 N=0对序列所有依次求和
----> 2 return pd.Series(S).rolling(N).sum().values if N>0 else pd.Series(S).cumsum().values
/opt/conda/envs/python2/lib/python2.7/site-packages/pandas/core/generic.pyc in __getattr__(self, name)
2148 return self[name]
2149 raise AttributeError("'%s' object has no attribute '%s'" %
-> 2150 (type(self).__name__, name))
2151
2152 def __setattr__(self, name, value):
AttributeError: 'Series' object has no attribute 'rolling'
2022-01-26