Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Frame ¶
type Frame interface { Cols() []string // TODO io.EOF for y out of range, io.ErrUnexpectedEOF for x out of range? Get(x, y int, dst ...interface{}) error }
A Frame is a two-dimensional data set.
The typical Frame has a small number of named columns and a potentially large number of rows. It is inspired by (and indeed may be implemented by) an SQL table. However, it is possible to have a Frame without column names, and some implementations make large columns as cheap as large rows.
Transforming a frame (slicing, aggregating, arithmetic, etc) is intended to be cheap. In some sense, transformations are lazily evaluated.
As a performance optimization, a Frame may implement any of the following methods to provide implementation-specific versions of the common frame package functions. Users should not use these directly, instead preferring the frame.Fn(f) version for any Fn:
ColumnNames() []string ColumnType(x int) Type Permute(cols []int) Frame Slice(x, xlen, y, ylen int) Frame Set(x, y int, vals ...interface{}) error Transpose() Frame CopyFrom(src Frame) (n int, err error) CopyTo(dst Frame) (n int, err error) Accumulate(g Grouping) (Frame, error) Len() (int, error)
Maybe TODO:
Slice(Rectangle) Frame Read(dst interface{}, col, off int) error // dst is []T.
func Slice ¶
Slice slices the Frame.
A ylen of -1 means maximize the length. That is, on a 2x2 Frame, Slice(f2x2, 0, 2, 1, -1) produces a 2x1 Frame. This is not intended to be an implementation of Python's negative indexes, it is simply necessary as it can be expensive or impossible to determine the Len of a frame.