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

Method SetNumRows

tensor/table/table.go:318–325  ·  view source on GitHub ↗

SetNumRows sets the number of rows in the table, across all columns if rows = 0 then effective number of rows in tensors is 1, as this dim cannot be 0

(rows int)

Source from the content-addressed store, hash-verified

316// SetNumRows sets the number of rows in the table, across all columns
317// if rows = 0 then effective number of rows in tensors is 1, as this dim cannot be 0
318func (dt *Table) SetNumRows(rows int) *Table { //types:add
319 dt.Rows = rows // can be 0
320 rows = max(1, rows)
321 for _, tsr := range dt.Columns {
322 tsr.SetNumRows(rows)
323 }
324 return dt
325}
326
327// note: no really clean definition of CopyFrom -- no point of re-using existing
328// table -- just clone it.

Callers 9

NewTestTableFunction · 0.95
NewSliceTableFunction · 0.95
AddRowsMethod · 0.95
ReadCSVMethod · 0.95
TestGaussianGenFunction · 0.95
TestBinomialGenFunction · 0.95
TestPoissonGenFunction · 0.95
TestGammaGenFunction · 0.95
TestBetaGenFunction · 0.95

Implementers 1

_cogentcore_org_core_plot_plots_Tableyaegicore/symbols/cogentcore_org-core-

Calls 1

SetNumRowsMethod · 0.65

Tested by 6

NewTestTableFunction · 0.76
TestGaussianGenFunction · 0.76
TestBinomialGenFunction · 0.76
TestPoissonGenFunction · 0.76
TestGammaGenFunction · 0.76
TestBetaGenFunction · 0.76