EmptyCopy copies the structure of datatable (no values)
()
| 2 | |
| 3 | // EmptyCopy copies the structure of datatable (no values) |
| 4 | func (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 |
| 21 | func (t *DataTable) Copy() *DataTable { |