1 Star 4 Fork 12

王布衣/pandas

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dataframe_remove.go 648 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2024-02-18 15:25 . dataframe适配series
package pandas
import (
"gitee.com/quant1x/gox/api"
)
// Remove 删除一段范围内的记录
func (this DataFrame) Remove(p api.ScopeLimit) DataFrame {
rowLen := this.Nrow()
start, end, err := p.Limits(rowLen)
if err != nil {
return this
}
columns := []Series{}
for i := range this.columns {
ht := this.columns[i].Subset(0, start, true)
tail := this.columns[i].Subset(end+1, rowLen).Values()
ht.Append(tail)
columns = append(columns, ht)
}
nrows, ncols, err := checkColumnsDimensions(columns...)
if err != nil {
return DataFrame{Err: err}
}
return DataFrame{
columns: columns,
ncols: ncols,
nrows: nrows,
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/quant1x/pandas.git
git@gitee.com:quant1x/pandas.git
quant1x
pandas
pandas
v1.3.3

搜索帮助