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

Function AddColumn

tensor/table/table.go:149–154  ·  view source on GitHub ↗

AddColumn adds a new column to the table, of given type and column name (which must be unique). The cells of this column hold a single scalar value: see AddColumnTensor for n-dimensional cells.

(dt *Table, name string)

Source from the content-addressed store, hash-verified

147// (which must be unique). The cells of this column hold a single scalar value:
148// see AddColumnTensor for n-dimensional cells.
149func AddColumn[T string | bool | float32 | float64 | int | int32 | byte](dt *Table, name string) tensor.Tensor {
150 rows := max(1, dt.Rows)
151 tsr := tensor.New[T]([]int{rows}, "Row")
152 dt.AddColumn(tsr, name)
153 return tsr
154}
155
156// InsertColumn inserts a new column to the table, of given type and column name
157// (which must be unique), at given index.

Callers

nothing calls this directly

Calls 1

AddColumnMethod · 0.80

Tested by

no test coverage detected