series

package
v0.0.0-...-88854b3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 15, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Mean  = AggregationMethod("Mean")
	Count = AggregationMethod("Count")
	Sum   = AggregationMethod("Sum")
	None  = AggregationMethod("")
)

Variables

This section is empty.

Functions

This section is empty.

Types

type AggregationMethod

type AggregationMethod string

type Name

type Name string

func NewName

func NewName(s string) Name

func (Name) String

func (n Name) String() string

type Series

type Series struct {
	Name             Name
	Elements         element.Elements
	AggregatedMethod AggregationMethod
}

Series list of same type of elements

func NewSeries

func NewSeries(name Name, elements element.Elements, aggregatedMethod AggregationMethod) (Series, error)

func (Series) AddElement

func (s Series) AddElement(element element.Element) (Series, error)

func (Series) Aggregate

func (s Series) Aggregate(method AggregationMethod) (element.Element, error)

func (Series) Append

func (s Series) Append(s2 Series) (Series, error)

func (Series) CanAggregateWith

func (s Series) CanAggregateWith(method AggregationMethod) error

CanAggregateWith Check if the series can be aggregated with the method

func (Series) Delete

func (s Series) Delete() Series

Delete delete elements with keeping its schema

func (Series) Floats

func (s Series) Floats() ([]float64, error)

Floats convert elements to float64 slice

func (Series) GetAggregatedMethod

func (s Series) GetAggregatedMethod() AggregationMethod

func (Series) GetElement

func (s Series) GetElement(index int) (element.Element, error)

func (Series) GetGroupedElement

func (s Series) GetGroupedElement() (element.Element, error)

GetGroupedElement returns a single element if all elements in the series are same

func (Series) GetName

func (s Series) GetName() Name

func (Series) GetType

func (s Series) GetType() Type

func (Series) Join

func (s Series) Join(separator string) (Series, error)

Join string elements with separator

func (Series) Len

func (s Series) Len() int

func (Series) Mean

func (s Series) Mean() (float64, error)

Mean Calculate the mean of all elements

func (Series) Slice

func (s Series) Slice(start int, end int) (Series, error)

Slice make a series with sliced subsets of string elements

func (Series) Split

func (s Series) Split(separator string, limit int) (Series, error)

Split string elements by separator

func (Series) Sum

func (s Series) Sum() (float64, error)

Sum Calculate the sum of all elements

func (Series) UpdateElements

func (s Series) UpdateElements(elements element.Elements) (Series, error)

type Type

type Type string
const (
	UnknownType    Type = ""
	StringType     Type = "string"
	StringListType Type = "string_list"
	NumericType    Type = "numeric"
	EnumType       Type = "enum"
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL