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

Method ColumnIndexTry

tensor/table/table.go:98–104  ·  view source on GitHub ↗

ColumnIndexTry returns the index of the given column name, along with an error if not found.

(name string)

Source from the content-addressed store, hash-verified

96// ColumnIndexTry returns the index of the given column name,
97// along with an error if not found.
98func (dt *Table) ColumnIndexTry(name string) (int, error) {
99 i, ok := dt.ColumnNameMap[name]
100 if !ok {
101 return 0, fmt.Errorf("table.Table ColumnIndex: column named: %v not found", name)
102 }
103 return i, nil
104}
105
106// ColumnIndexesByNames returns the indexes of the given column names.
107// idxs have -1 if name not found -- see Try version for error message.

Callers 15

DeleteColumnNameMethod · 0.95
genPlotXYMethod · 0.80
newTableXYNameFunction · 0.80
genPlotBarMethod · 0.80
plotXAxisMethod · 0.80
SortColumnNameMethod · 0.80
SortColumnNamesMethod · 0.80
SortStableColumnNameMethod · 0.80
SortStableColumnNamesMethod · 0.80
FilterColumnNameMethod · 0.80
RowsByStringTryMethod · 0.80
AggColumnTryFunction · 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