1 Star 4 Fork 11

王布衣 / pandas

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
avedev.go 430 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2024-02-12 22:35 . 调整包路径
package formula
import (
"gitee.com/quant1x/num"
"gitee.com/quant1x/pandas"
)
// AVEDEV 平均绝对偏差, (序列与其平均值的绝对差的平均值)
//
// AVEDEV(S,N) 返回平均绝对偏差
func AVEDEV(S pandas.Series, N any) pandas.Series {
return S.Rolling(N).Apply(func(X pandas.Series, W num.DType) num.DType {
x := X.DTypes()
x1 := X.Mean()
r := num.Sub(x, x1)
r = num.Abs(r)
return num.Mean(r)
})
}
Go
1
https://gitee.com/quant1x/pandas.git
git@gitee.com:quant1x/pandas.git
quant1x
pandas
pandas
v1.4.7

搜索帮助