series

package
v0.0.0-...-8c0dd20 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2020 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Condition

type Condition func(interface{}) bool

Condition represents a function which can be applied to any value and return a boolean.

type Series

type Series struct {
	array.Interface
	// contains filtered or unexported fields
}

Series ... TODO: TRY A CHUNKED / COLUMN VERSION OF SERIES TODO: ADD PRECISION

func FromArrow

func FromArrow(pool memory.Allocator, field arrow.Field, column array.Interface) Series

FromArrow creates a Series from an Arrow array.

func FromFloat32

func FromFloat32(pool memory.Allocator, field arrow.Field, vals []float32, valid []bool) Series

FromFloat32 creates a Series from a slice of float32 values.

func FromFloat64

func FromFloat64(pool memory.Allocator, field arrow.Field, vals []float64, valid []bool) Series

FromFloat64 creates a Series from a slice of float64 values.

func FromInt32

func FromInt32(pool memory.Allocator, field arrow.Field, vals []int32, valid []bool) Series

FromInt32 creates a Series from a slice of int32 values.

TODO(poopoothegorilla): might be worth creating a pool of builders and recycling them. TODO(poopoothegorilla): should the arrow.Field be replaced by a string param and constructed in the function?

func FromInt64

func FromInt64(pool memory.Allocator, field arrow.Field, vals []int64, valid []bool) Series

FromInt64 creates a Series from a slice of int64 values.

func FromInterface

func FromInterface(pool memory.Allocator, field arrow.Field, vals interface{}, valid []bool) Series

FromInterface creates a Series from a slice of supported types.

func FromString

func FromString(pool memory.Allocator, field arrow.Field, vals []string, valid []bool) Series

FromString creates a Series from a slice of string values.

func (Series) Abs

func (s Series) Abs() Series

Abs returns a Series with all absolute values.

TODO(poopoothegorilla): need to pass valids into new Series.

func (Series) Add

func (s Series) Add(ss Series) Series

Add adds two equal length and type Series and returns the resulting Series.

func (Series) Append

func (s Series) Append(ss Series) Series

Append returns a Series with the values from the ss Series appended to the s Series.

func (Series) At

func (s Series) At(i, _ int) float64

At returns the float64 value at the i position in the Series.

func (Series) AtVec

func (s Series) AtVec(i int) float64

AtVec returns a float64 value at position i.

func (Series) Cast

func (s Series) Cast(t arrow.DataType) Series

Cast returns a new series of t type.

func (Series) Column

func (s Series) Column() *array.Column

Column returns an Arrow array column.

func (Series) Dims

func (s Series) Dims() (r, c int)

Dims returns the dimensions of the Series as rows and columns.

func (Series) Dot

func (s Series) Dot(ss Series) float64

Dot returns the Dot product of all values in the Series as a float64 value.

func (Series) DropIndices

func (s Series) DropIndices(indices []int) Series

DropIndices returns a Series without values located at the provided indices.

TODO(poopoothegorilla): add DropByMask either as seperate function or choose by options.

func (Series) DropNA

func (s Series) DropNA() Series

DropNA returns a Series without null values.

func (Series) Empty

func (s Series) Empty(n int) Series

Empty creates an empty Series with n elements.

func (Series) Field

func (s Series) Field() arrow.Field

Field returns the Arrow field associated with the Series.

func (Series) FindIndices

func (s Series) FindIndices(val interface{}) []int

FindIndices returns a slice of indices where the value exists.

func (Series) Float32

func (s Series) Float32(i int) float32

Float32 returns the value at position i from the Series as an float32.

func (Series) Float64

func (s Series) Float64(i int) float64

Float64 returns the value at position i from the Series as an float64.

func (Series) Head

func (s Series) Head(n int) Series

Head returns a Series with n values.

func (Series) Int32

func (s Series) Int32(i int) int32

Int32 returns the value at position i from the Series as an int32.

func (Series) Int64

func (s Series) Int64(i int) int64

Int64 returns the value at position i from the Series as an int64.

func (Series) IsNA

func (s Series) IsNA() []bool

IsNA returns a slice of bools indicating positions where values are null.

func (Series) Magnitude

func (s Series) Magnitude() float64

Magnitude returns the magnitude of the Series as a float64 value.

func (Series) Map

func (s Series) Map(fn func(interface{}) interface{}) Series

Map applies the fn function to all values in the s Series and returns a Series with the resulting values.

func (Series) Max

func (s Series) Max() float64

Max returns the maximum value of the Series as a float64.

func (Series) Mean

func (s Series) Mean() float64

Mean retuns the mean of the Series as a float64.

func (Series) Median

func (s Series) Median() float64

Median returns the median value of the Series as a float64.

TODO(poopoothegorilla): inefficient could be improved

func (Series) Min

func (s Series) Min() float64

Min returns the minimum value of the Series as a float64.

func (Series) NAIndices

func (s Series) NAIndices() []int

NAIndices returns the indices where values are null.

TODO{poopoothegorilla): COULD BE IMPROVED PERFORMANCE WISE... MAYBE USE NULL BITMASK

func (Series) Name

func (s Series) Name() string

Name returns the Series name.

func (Series) Rename

func (s Series) Rename(name string) Series

Rename returns a Series with a new name.

func (Series) STD

func (s Series) STD() float64

STD returns the standard deviation of the Series as a float64 value.

func (Series) SelectIndices

func (s Series) SelectIndices(indices []int) Series

SelectIndices returns a Series with values only present in the provided indices.

func (Series) SortValues

func (s Series) SortValues() Series

SortValues returns a Series with sorted values.

TODO(poopoothegorilla): add sort options

func (Series) Sqrt

func (s Series) Sqrt() Series

Sqrt returns a Series with the square root of all values.

func (Series) Square

func (s Series) Square() Series

Square returns a Series with all values squared.

func (Series) String

func (s Series) String() string

String returns a representation of the data as a string.

func (Series) StringValues

func (s Series) StringValues() []string

StringValues returns the values of the Series as a slice of strings.

func (Series) Subtract

func (s Series) Subtract(ss Series) Series

Subtract subtracts two equal length and type Series and returns the resulting Series.

func (Series) Sum

func (s Series) Sum() float64

Sum returns the sum of all values in the Series as a float64 value.

func (Series) T

func (s Series) T() mat.Matrix

T returns the transpose of the Series which is itself.

func (Series) Truncate

func (s Series) Truncate(i, j int64) Series

Truncate returns a truncated Series.

func (Series) Unique

func (s Series) Unique() Series

Unique returns a new series with only unique values.

func (Series) Value

func (s Series) Value(i int) interface{}

Value returns the value at position i from the Series as an interface.

func (Series) Values

func (s Series) Values() interface{}

Values returns the values of the Series as a slice of types.

func (Series) Where

func (s Series) Where(cs ...Condition) Series

Where returns a Series where values satisfy any of the conditions.

Jump to

Keyboard shortcuts

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