1 Star 4 Fork 11

王布衣 / pandas

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
if.go 533 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2023-02-18 15:26 . !68修订部分问题, 清理package
package formula
import (
"gitee.com/quant1x/pandas/stat"
)
// IF 序列布尔判断 return=A if S==True else B
func IF(S, A, B stat.Series) stat.Series {
return IFF(S, A, B)
}
// IFF 序列布尔判断 return=A if S==True else B
func IFF(S, A, B stat.Series) stat.Series {
s := S.DTypes()
a := A.DTypes()
b := B.DTypes()
ret := stat.Where(s, a, b)
return stat.NewSeries[stat.DType](ret...)
}
// IFN 序列布尔判断 return=A if S==False else B
func IFN(S, A, B stat.Series) stat.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.22

搜索帮助

344bd9b3 5694891 D2dac590 5694891