MCPcopy Create free account
hub / github.com/cogentcore/core / InsertColumn

Function InsertColumn

tensor/table/table.go:159–164  ·  view source on GitHub ↗

InsertColumn inserts a new column to the table, of given type and column name (which must be unique), at given index. The cells of this column hold a single scalar value.

(dt *Table, name string, idx int)

Source from the content-addressed store, hash-verified

157// (which must be unique), at given index.
158// The cells of this column hold a single scalar value.
159func InsertColumn[T string | bool | float32 | float64 | int | int32 | byte](dt *Table, name string, idx int) tensor.Tensor {
160 rows := max(1, dt.Rows)
161 tsr := tensor.New[T]([]int{rows}, "Row")
162 dt.InsertColumn(tsr, name, idx)
163 return tsr
164}
165
166// AddTensorColumn adds a new n-dimensional column to the table, of given type, column name
167// (which must be unique), and dimensionality of each _cell_.

Callers

nothing calls this directly

Calls 1

InsertColumnMethod · 0.80

Tested by

no test coverage detected