Documentation
¶
Overview ¶
Package table provides functionality for working with tables.
Index ¶
- type Reader
- type Table
- func (t *Table) Column(col string) int
- func (t *Table) ColumnNames() []string
- func (t *Table) Columns() int
- func (t *Table) Data() []float64
- func (t *Table) DeNormalizeColumn(col int, n norm.Normalizer)
- func (t *Table) Get(row, col int) float64
- func (t *Table) GetRow(row int) []float64
- func (t *Table) MeanStdDev(col int) (float64, float64)
- func (t *Table) NormalizeColumn(col int, n norm.Normalizer)
- func (t *Table) Range(col int) (min, max float64)
- func (t *Table) Rows() int
- func (t *Table) Set(row, col int, value float64)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Reader ¶
type Reader interface {
ReadColumns(columns []string) (*Table, error)
ReadLabels(column string) ([]string, error)
}
Reader is an interface that provides methods for reading data into a Table.
ReadColumns reads the data for the specified columns into a new Table. If an error occurs during reading, it is returned.
ReadLabels reads the labels for the specified column into a slice of strings. If an error occurs during reading, it is returned.
type Table ¶
type Table struct {
// contains filtered or unexported fields
}
Table represents a table of data with columns and rows.
func New ¶
New creates a new Table with the given column names and number of rows. The data slice is initialized to all zeros.
func NewWithData ¶
NewWithData creates a new Table from the given column names and data. If the length of the columns slice is zero, an error is returned. If the length of the data slice is not a multiple of the length of the columns slice, an error is returned.
func (*Table) Column ¶
Column returns the index of the column with the given name. If the column is not found, -1 is returned.
func (*Table) ColumnNames ¶
func (*Table) DeNormalizeColumn ¶
func (t *Table) DeNormalizeColumn(col int, n norm.Normalizer)
func (*Table) NormalizeColumn ¶
func (t *Table) NormalizeColumn(col int, n norm.Normalizer)