1 Star 4 Fork 11

王布衣 / pandas

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
avedev.go 409 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2023-02-18 15:26 . !68修订部分问题, 清理package
package formula
import (
"gitee.com/quant1x/pandas/stat"
)
// AVEDEV 平均绝对偏差, (序列与其平均值的绝对差的平均值)
//
// AVEDEV(S,N) 返回平均绝对偏差
func AVEDEV(S stat.Series, N any) stat.Series {
return S.Rolling(N).Apply(func(X stat.Series, W stat.DType) stat.DType {
x := X.DTypes()
x1 := X.Mean()
r := stat.Sub(x, x1)
r = stat.Abs(r)
return stat.Mean(r)
})
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/pandas.git
git@gitee.com:quant1x/pandas.git
quant1x
pandas
pandas
v0.8.4

搜索帮助

344bd9b3 5694891 D2dac590 5694891