func (dt *Table) ColName(i int) string {
	return dt.ColNames[i]
}
ColName returns the name of given column
package etable
import (
	"fmt"
	"log"
	"math"
	"strings"
	"github.com/emer/etable/etensor"
	"github.com/goki/ki/ints"
	"github.com/goki/ki/ki"
	"github.com/goki/ki/kit"
)
type Table struct {
	Cols       []etensor.Tensor  `view:"no-inline" desc:"columns of data, as etensor.Tensor tensors"`
	ColNames   []string          `desc:"the names of the columns"`
	Rows       int               `inactive:"+" desc:"number of rows, which is enforced to be the size of the outer-most dimension of the column tensors"`
	ColNameMap map[string]int    `view:"-" desc:"the map of column names to column numbers"`
	MetaData   map[string]string `desc:"misc meta data for the table.  We use lower-case key names following the struct tag convention:  name = name of table; desc = description; read-only = gui is read-only; precision = n for precision to write out floats in csv.  For Column-specific data, we look for ColName: prefix, specifically ColName:desc = description of the column contents, which is shown as tooltip in the etview.TableView, and :width for width of a column"`
}
var KiT_Table = kit.Types.AddType(&Table{}, TableProps)
func (dt *Table) NumRows() int {
	return dt.Rows
}
func (dt *Table) IsValidRow(row int) bool {
	if row < 0 || row >= dt.Rows {
		return false
	}
	return true
}
func (dt *Table) IsValidRowTry(row int) error {
	if row < 0 || row >= dt.Rows {
		return fmt.Errorf("etable.Table Row: %v is not valid for table with Rows: %v\n", row, dt.Rows)
	}
	return nil
}
func (dt *Table) NumCols() int {
	return len(dt.Cols)
}
func (dt *Table) Col(i int) etensor.Tensor {
	return dt.Cols[i]
}
func (dt *Table) ColByName(name string) etensor.Tensor {
	i, ok := dt.ColNameMap[name]
	if !ok {
		return nil
	}
	return dt.Cols[i]
}
func (dt *Table) ColByNameTry(name string) (etensor.Tensor, error) {
	i, err := dt.ColIdxTry(name)
	if err != nil {
		return nil, err
	}
	return dt.Cols[i], nil
}
func (dt *Table) ColIdx(name string) int {
	i, ok := dt.ColNameMap[name]
	if !ok {
		return -1
	}
	return i
}
func (dt *Table) ColIdxTry(name string) (int, error) {
	i, ok := dt.ColNameMap[name]
	if !ok {
		return 0, fmt.Errorf("etable.Table ColIdx: column named: %v not found", name)
	}
	return i, nil
}
func (dt *Table) ColIdxsByNames(names []string) []int {
	nc := len(names)
	if nc == 0 {
		return nil
	}
	cidx := make([]int, nc)
	for i, cn := range names {
		cidx[i] = dt.ColIdx(cn)
	}
	return cidx
}
func (dt *Table) ColIdxsByNamesTry(names []string) ([]int, error) {
	nc := len(names)
	if nc == 0 {
		return nil, fmt.Errorf("etable.Table ColsByNamesIdxs: no column names provided")
	}
	cidx := make([]int, nc)
	var err error
	for i, cn := range names {
		cidx[i], err = dt.ColIdxTry(cn)
		if err != nil {
			return nil, err
		}
	}
	return cidx, nil
}