1 Star 4 Fork 10

王布衣 / pandas

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
vector_ewm.go 685 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2024-02-25 21:53 . 调整EWM数据为clone
package pandas
import "slices"
func (this vector[T]) EWM(alpha EW) ExponentialMovingWindow {
atype := AlphaAlpha
param := 0.00
adjust := alpha.Adjust
ignoreNA := alpha.IgnoreNA
if alpha.Com != 0 {
atype = AlphaCom
param = alpha.Com
} else if alpha.Span != 0 {
atype = AlphaSpan
param = alpha.Span
} else if alpha.HalfLife != 0 {
atype = AlphaHalfLife
param = alpha.HalfLife
} else {
atype = AlphaAlpha
param = alpha.Alpha
}
values := slices.Clone(this.DTypes())
dest := SliceToSeries(values)
return ExponentialMovingWindow{
Data: dest,
AType: atype,
Param: param,
Adjust: adjust,
IgnoreNA: ignoreNA,
Cb: alpha.Callback,
}
}
Go
1
https://gitee.com/quant1x/pandas.git
git@gitee.com:quant1x/pandas.git
quant1x
pandas
pandas
v1.4.7

搜索帮助