MCPcopy Create free account
hub / github.com/datasweet/datatable / EmptyCopy

Method EmptyCopy

copy.go:4–18  ·  view source on GitHub ↗

EmptyCopy copies the structure of datatable (no values)

()

Source from the content-addressed store, hash-verified

2
3// EmptyCopy copies the structure of datatable (no values)
4func (t *DataTable) EmptyCopy() *DataTable {
5 cpy := &DataTable{
6 name: t.name,
7 dirty: t.dirty,
8 hasExpr: t.hasExpr,
9 nrows: 0,
10 cols: make([]*column, len(t.cols)),
11 }
12
13 for i, col := range t.cols {
14 cpy.cols[i] = col.emptyCopy()
15 }
16
17 return cpy
18}
19
20// Copy the datatable
21func (t *DataTable) Copy() *DataTable {

Callers 3

WhereMethod · 0.95
ConcatMethod · 0.95
SubsetMethod · 0.95

Calls 1

emptyCopyMethod · 0.80

Tested by

no test coverage detected