1 Star 4 Fork 12

王布衣/pandas

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
sum.go 534 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2023-02-08 05:30 . !37#I6DLC4实现BARSLAST函数
package formula
import (
"gitee.com/quant1x/pandas"
)
// SUM 求累和
// 如果N=0, 则从第一个有效值累加到当前
// 下一步再统一返回值
func SUM(S pandas.Series, N any) any {
//var X []float32
//switch v := N.(type) {
//case int:
// X = stat.Repeat[float32](float32(v), S.Len())
//case pandas.Series:
// vs := v.Values()
// X = pandas.SliceToFloat32(vs)
// X = stat.Align(X, pandas.Nil2Float32, S.Len())
//default:
// panic(exception.New(1, "error window"))
//}
return S.Rolling(N).Sum().Values()
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/pandas.git
git@gitee.com:quant1x/pandas.git
quant1x
pandas
pandas
v0.6.4

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385