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)
| 147 | // (which must be unique). The cells of this column hold a single scalar value: |
| 148 | // see AddColumnTensor for n-dimensional cells. |
| 149 | func 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. |