1 Star 4 Fork 11

王布衣 / pandas

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
dataframe_remove.go 653 Bytes
一键复制 编辑 原始数据 按行查看 历史
王布衣 提交于 2023-02-14 08:08 . !59#I6F1P2优化序列处理方式
package pandas
import "gitee.com/quant1x/pandas/stat"
// Remove 删除一段范围内的记录
func (self DataFrame) Remove(p stat.ScopeLimit) DataFrame {
rowLen := self.Nrow()
start, end, err := p.Limits(rowLen)
if err != nil {
return self
}
columns := []stat.Series{}
for i := range self.columns {
ht := self.columns[i].Subset(0, start, true)
tail := self.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
v0.6.14

搜索帮助

344bd9b3 5694891 D2dac590 5694891