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

Method Float

tensor/table/table.go:458–470  ·  view source on GitHub ↗

Float returns the float64 value of cell at given column (by name), row index for columns that have 1-dimensional tensors. Returns NaN if column is not a 1-dimensional tensor or col name not found, or row not valid.

(column string, row int)

Source from the content-addressed store, hash-verified

456// for columns that have 1-dimensional tensors.
457// Returns NaN if column is not a 1-dimensional tensor or col name not found, or row not valid.
458func (dt *Table) Float(column string, row int) float64 {
459 if !dt.IsValidRow(row) {
460 return math.NaN()
461 }
462 ct := dt.ColumnByName(column)
463 if ct == nil {
464 return math.NaN()
465 }
466 if ct.NumDims() != 1 {
467 return math.NaN()
468 }
469 return ct.Float1D(row)
470}
471
472// StringIndex returns the string value of cell at given column, row index
473// for columns that have 1-dimensional tensors.

Callers 2

TestHistogram32Function · 0.95
TestHistogram64Function · 0.95

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 4

IsValidRowMethod · 0.95
ColumnByNameMethod · 0.95
NumDimsMethod · 0.65
Float1DMethod · 0.65

Tested by 2

TestHistogram32Function · 0.76
TestHistogram64Function · 0.76