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

Method ColumnByNameTry

tensor/table/table.go:78–84  ·  view source on GitHub ↗

ColumnByNameTry returns the tensor at given column name, with error message if not found. Returns nil if not found

(name string)

Source from the content-addressed store, hash-verified

76// ColumnByNameTry returns the tensor at given column name, with error message if not found.
77// Returns nil if not found
78func (dt *Table) ColumnByNameTry(name string) (tensor.Tensor, error) {
79 i, ok := dt.ColumnNameMap[name]
80 if !ok {
81 return nil, fmt.Errorf("table.Table ColumnByNameTry: column named: %v not found", name)
82 }
83 return dt.Columns[i], nil
84}
85
86// ColumnIndex returns the index of the given column name.
87// returns -1 if name not found -- see Try version for error message.

Callers 7

TableColMethod · 0.80
SetTableMethod · 0.80
ProjectColMethod · 0.80
ProjectColToTableMethod · 0.80
CovarTableColFunction · 0.80
ProjectColMethod · 0.80
ProjectColToTableMethod · 0.80

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 1

ErrorfMethod · 0.65

Tested by

no test coverage detected