1 Star 4 Fork 11

王布衣 / pandas

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
if.go 589 Bytes
一键复制 编辑 原始数据 按行查看 历史
package formula
import (
"gitee.com/quant1x/pandas"
"gitee.com/quant1x/pandas/stat"
)
// IF 序列布尔判断 return=A if S==True else B
func IF(S, A, B pandas.Series) pandas.Series {
return IFF(S, A, B)
}
// IFF 序列布尔判断 return=A if S==True else B
func IFF(S, A, B pandas.Series) pandas.Series {
s := S.Float()
a := A.Float()
b := B.Float()
ret := stat.Where(s, a, b)
return pandas.NewSeries(pandas.SERIES_TYPE_FLOAT32, "", ret)
}
// IFN 序列布尔判断 return=A if S==False else B
func IFN(S, A, B pandas.Series) pandas.Series {
return IFF(S, B, A)
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/pandas.git
git@gitee.com:quant1x/pandas.git
quant1x
pandas
pandas
v0.6.5

搜索帮助

344bd9b3 5694891 D2dac590 5694891