dt

package module
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 21, 2020 License: MIT Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsNA

func IsNA(a Value) bool

IsNA checks if a is NA.

Types

type Frame

type Frame struct {
	// contains filtered or unexported fields
}

Frame is the frame data structure.

func NewFrame

func NewFrame(keys ...string) *Frame

NewFrame creates a new frame.

func (*Frame) Add

func (a *Frame) Add(key string, list List) *Frame

Add adds the list with key.

func (*Frame) Append

func (a *Frame) Append(rs ...Record) *Frame

Append appends x to frames a.

func (*Frame) Check added in v0.1.1

func (a *Frame) Check(keys ...string) error

Check checks if the frame has the keys.

func (*Frame) Concat

func (a *Frame) Concat(b *Frame) *Frame

Concat concats frame a with b.

func (*Frame) Copy

func (a *Frame) Copy(deep bool) *Frame

Copy makes a copy of frame a.

func (*Frame) Del

func (a *Frame) Del(keys ...string) *Frame

Del deletes the list by keys.

func (*Frame) DropNA

func (a *Frame) DropNA(keys ...string) *Frame

DropNA drops NA value.

func (*Frame) Empty

func (a *Frame) Empty() *Frame

Empty returns a empty frame like frame a.

func (*Frame) FillNA

func (a *Frame) FillNA(value Value, keys ...string) *Frame

FillNA fills NA value with v.

func (*Frame) Filter

func (a *Frame) Filter(f func(Record) bool) *Frame

Filter filters the frame with function f.

func (*Frame) Get

func (a *Frame) Get(key string) List

Get gets the list by key.

func (*Frame) GroupBy

func (a *Frame) GroupBy(key string, keys ...string) *Group

GroupBy groups records by keys.

func (*Frame) Has

func (a *Frame) Has(keys ...string) bool

Has checks if the frame has the keys.

func (*Frame) Iter

func (a *Frame) Iter() *Iter

Iter returns a iter of frame a.

func (*Frame) Join

func (a *Frame) Join(b *Frame, key string, keys ...string) *Join

Join joins frame a and b.

func (*Frame) Keys

func (a *Frame) Keys() []string

Keys returns the keys of frame a.

func (*Frame) Len

func (a *Frame) Len() int

Len returns the length of frame a.

func (*Frame) Lists

func (a *Frame) Lists() []List

Lists returns the lists of frame a.

func (*Frame) Map

func (a *Frame) Map(f func(Record) Value) List

Map maps frame a to list by function f.

func (*Frame) MapTo

func (a *Frame) MapTo(key string, f func(Record) Value) *Frame

MapTo maps frame a to the key list.

func (*Frame) Pick

func (a *Frame) Pick(key string, keys ...string) *Frame

Pick picks some lists and returns a new frame,

func (*Frame) Rename

func (a *Frame) Rename(old, new string) *Frame

Rename renames the key.

func (*Frame) Set

func (a *Frame) Set(key string, list List) *Frame

Set sets the list by key.

func (*Frame) Slice

func (a *Frame) Slice(i, j int) *Frame

Slice gets the slice of frame a.

func (*Frame) Sort

func (a *Frame) Sort(f func(Record, Record) bool) *Frame

Sort sorts frame a by function f.

func (*Frame) String

func (a *Frame) String() string

String shows frame a as string.

type Group

type Group struct {
	// contains filtered or unexported fields
}

Group is a group data structure.

func (*Group) Apply

func (a *Group) Apply(key string, name string, f func(List) Value) *Group

Apply applies the aggregate function to group a.

func (*Group) Do

func (a *Group) Do() *Frame

Do does the group.

type Iter

type Iter struct {
	// contains filtered or unexported fields
}

Iter is a iter of frame.

func (*Iter) Next

func (a *Iter) Next() bool

Next check if has next record.

func (*Iter) Record

func (a *Iter) Record() Record

Record returns the current record.

type Join

type Join struct {
	// contains filtered or unexported fields
}

Join is the join option.

func (*Join) Do

func (a *Join) Do(prefix string) *Frame

Do does the join operation.

func (*Join) On

func (a *Join) On(key string, keys ...string) *Join

On sets the left keys.

type List

type List []Value

List is the list data structure.

func (List) FillNA

func (a List) FillNA(value Value) List

FillNA fills NA value with value.

func (List) Filter

func (a List) Filter(f func(Value) bool) List

Filter filters the list with function f.

func (List) Map

func (a List) Map(f func(Value) Value) List

Map maps the list by function f.

func (List) Number

func (a List) Number() List

Number converts the list to float list.

func (List) String

func (a List) String() List

String converts the list to string list.

type Number

type Number float64

Number is a float64 value.

func (Number) Number

func (a Number) Number() float64

Number returns as a number value.

func (Number) String

func (a Number) String() string

String returns as a string value.

type Record

type Record interface {
	Value(key string) Value
	Number(key string) float64
	String(key string) string
}

Record is the record interface.

type String

type String string

String is a string value.

func (String) Number

func (a String) Number() float64

Number returns as a number value.

func (String) String

func (a String) String() string

String returns as a string value.

type Value

type Value interface {
	Number() float64
	String() string
}

Value is the value interface.

func Count

func Count(l List) Value

Count returns the count of list l.

func First

func First(l List) Value

First returns the first of list l.

func Last

func Last(l List) Value

Last returns the last of list l.

func Max

func Max(l List) Value

Max returns the max of list l.

func Mean

func Mean(l List) Value

Mean returns the mean of list l.

func Min

func Min(l List) Value

Min returns the min of list l.

func Std

func Std(l List) Value

Std returns the std of list l.

func Sum

func Sum(l List) Value

Sum returns the sum of list l.

func Var

func Var(l List) Value

Var returns the var of list l.

Directories

Path Synopsis
io
csv

Jump to

Keyboard shortcuts

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