(S_BOOL,S_TRUE,S_FALSE)
| 25 | return pd.Series(S).rolling(N).std(ddof=0).values |
| 26 | |
| 27 | def IF(S_BOOL,S_TRUE,S_FALSE): #序列布尔判断 res=S_TRUE if S_BOOL==True else S_FALSE |
| 28 | return np.where(S_BOOL, S_TRUE, S_FALSE) |
| 29 | |
| 30 | def SUM(S, N): #对序列求N天累计和,返回序列 |
| 31 | return pd.Series(S).rolling(N).sum().values |