Documentation ¶
Index ¶
- Constants
- type Comparator
- type Indexes
- type Series
- func (s Series) Addr() []string
- func (s *Series) Append(values interface{})
- func (s Series) Bool() ([]bool, error)
- func (s Series) Compare(comparator Comparator, comparando interface{}) Series
- func (s Series) Concat(x Series) Series
- func (s Series) Copy() Series
- func (s Series) Elem(i int) elementInterface
- func (s Series) Empty() Series
- func (s Series) Float() []float64
- func (s Series) HasNaN() bool
- func (s Series) Int() ([]int, error)
- func (s Series) Len() int
- func (s Series) Records() []string
- func (s Series) Set(indexes Indexes, newvalues Series) Series
- func (s Series) Str() string
- func (s Series) String() string
- func (s Series) Subset(indexes Indexes) Series
- func (s Series) Type() Type
- func (s Series) Val(i int) (interface{}, error)
- type Type
Constants ¶
const ( Eq Comparator = "==" // Equal Neq = "!=" // Non equal Greater = ">" // Greater than GreaterEq = ">=" // Greater or equal than Less = "<" // Lesser than LessEq = "<=" // Lesser or equal than In = "in" // Inside )
Supported Comparators
const ( String Type = "string" Int = "int" Float = "float" Bool = "bool" )
Supported Series Types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comparator ¶
type Comparator string
Comparator is a convenience alias that can be used for a more type safe way of reason and use comparators.
type Indexes ¶
type Indexes interface{}
Indexes represent the elements that can be used for selecting a subset of elements within a Series. Currently supported are:
int // Matches the given index number []int // Matches all given index numbers []bool // Matches all elements in a Series marked as true Series [Int] // Same as []int Series [Bool] // Same as []bool
type Series ¶
type Series struct { Name string // The name of the series Err error // If there are errors they are stored here // contains filtered or unexported fields }
Series is a data structure designed for operating on arrays of elements that should comply with a certain type structure. They are flexible enough that can be transformed to other Series types and account for missing or non valid elements. Most of the power of Series resides on the ability to compare and subset Series of different types.
func (Series) Addr ¶
Addr returns the string representation of the memory address that store the values of a given Series.
func (*Series) Append ¶
func (s *Series) Append(values interface{})
Append adds new elements to the end of the Series. When using Append, the Series is modified in place.
func (Series) Bool ¶
Bool returns the elements of a Series as a []bool or an error if the transformation is not possible.
func (Series) Compare ¶
func (s Series) Compare(comparator Comparator, comparando interface{}) Series
Compare compares the values of a Series with other elements. To do so, the elements with are to be compared are first transformed to a Series of the same type as the caller.
func (Series) Concat ¶
Concat concatenates two series together. It will return a new Series with the combined elements of both Series.
func (Series) Elem ¶
Elem returns the element of a series for the given index or nil if the index is out of bounds
func (Series) Float ¶
Float returns the elements of a Series as a []float64. If the elements can not be converted to float64 or contains a NaN returns the float representation of NaN.
func (Series) Int ¶
Int returns the elements of a Series as a []int or an error if the transformation is not possible.
func (Series) Set ¶
Set sets the values on the indexes of a Series and returns a new one with these modifications. The original Series is not changed.