1 Star 4 Fork 10

王布衣 / pandas

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dataframe_remove.go 655 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2024-02-26 12:06 . 优化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, false).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,
}
}
Go
1
https://gitee.com/quant1x/pandas.git
git@gitee.com:quant1x/pandas.git
quant1x
pandas
pandas
v1.4.5

搜索帮助