Documentation
¶
Overview ¶
A package to manage R-like data frames.
DataFrame ¶
A DataFrame is a table where columns are variables and rows are measurements. For example:
row room wifi acceleration 0 KITCHEN [-56.1, -78.9, -44.12] 1.3 1 BATH [-58, -71.1, -39.8] 1.8 ...
Each column correspond to a variable. Each variable can have a different type. In this case, room is a string, wifi is an array of numbers, and acceleration is a number. In JSON:
{ "description": "An indoor positioning data set.", "batchid": "24001-015", "var_names": ["room", "wifi", "acceleration"], "properties": {"url": "http://akualab.com", "status": "experimental"}, "data": [ ["KITCHEN", [-56.1, -78.9, -44.12], 1.3], ["BATH" , [-58, -71.1, -39.8], 1.8] ] }
DataSet ¶
A DataSet is a collection of DataFrame files. All files must have the same schema. The API provides methods to iterate over the DataSet which hides teh details about files from the end user.
Index ¶
- Constants
- type DataFrame
- func (df *DataFrame) Float64Slice(frame int, names ...string) (floats []float64, err error)
- func (df *DataFrame) Float64SliceChannel(names ...string) (ch chan []float64)
- func (df *DataFrame) N() int
- func (df *DataFrame) NumVariables() int
- func (df *DataFrame) String(frame int, name string) (value string, err error)
- type DataSet
Constants ¶
const (
BUFFER_SIZE = 1000
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DataFrame ¶
type DataFrame struct { // Describes the data. Description string `json:"description"` // Identifies the batch or data. For example: a session, a file, etc. BatchID string `json:"batchid"` // Ordered list of variable names. VarNames []string `json:"var_names"` // Ordered list of variables. Data [][]interface{} `json:"data"` // Can be used to store custom properties related to the data frame. Properties map[string]string `json:"properties"` // contains filtered or unexported fields }
A DataFrame is a table where columns are variables and rows are measurements. Each row contains an instance. Each variable can have a different type.
func ReadDataFrame ¶
Reads features from io.Reader.
func ReadDataFrameFile ¶
Reads feature from file.
func (*DataFrame) Float64Slice ¶
Joins float64 and []float64 variables and returns them as a []float64.
func (*DataFrame) Float64SliceChannel ¶
Joins float64 and []float64 variables. Returns a channel of []float64 frames.
func (*DataFrame) NumVariables ¶
Returns number of variables (columns) in data frame.
type DataSet ¶
type DataSet struct { Path string `yaml:"path"` Files []string `yaml:"files"` // contains filtered or unexported fields }
A list of dataframe files. Each file must have the same dataframe schema.
func ReadDataSet ¶
Reads a list of filenames from an io.Reader.
func ReadDataSetFile ¶
Reads a list of filenames from a file. See ReadDataSetReader()
func (*DataSet) Float64SliceChannel ¶
Resets data set and starts reading data. Returns a channel to be used to get all the frames.