dataframe

package module
v0.0.0-...-3b8c999 Latest Latest
Warning

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

Go to latest
Published: Sep 19, 2019 License: MIT Imports: 3 Imported by: 0

README

dataframe

GoDoc  Go Report Card

Features

  • Support bool, number, string and custom types.
  • Separate dataFrame implementation and operation functions, which means custom functions are easy to define.
  • Less interfaces and pointers, higher performance.

Design

  • Operations on interfaces are expensive, so using interface casually should be avoided.
  • Less method definitions, so series could be easier to customized.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CustomSeries

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

func (CustomSeries) GetBool

func (CustomSeries) GetBool(i int) bool

func (CustomSeries) GetNumber

func (CustomSeries) GetNumber(i int) float64

func (CustomSeries) GetString

func (CustomSeries) GetString(i int) string

func (CustomSeries) SetBool

func (CustomSeries) SetBool(i int, v bool)

func (CustomSeries) SetNumber

func (CustomSeries) SetNumber(i int, v float64)

func (CustomSeries) SetString

func (CustomSeries) SetString(i int, v string)

type DataFrame

type DataFrame interface {
	NRow() int
	NCol() int

	GetAllSeries() []Series
	GetSeries(name string) (index int, s Series, ok bool)
	SetSeries(series Series) error
	// SetSeriesDirectly set series by index, without looking up by name of series.
	SetSeriesDirectly(index int, series Series) error
	AppendSeries(series ...Series) error

	Copy() DataFrame
	Select(indexes []int) DataFrame

	String() string
}

func NewDataFrame

func NewDataFrame(nrow int, options ...Option) DataFrame

type Option

type Option func(*optionValues)

func WithFormatter

func WithFormatter(f formatter) Option

type Series

type Series interface {
	Type() Type
	Name() string
	Rename(s string)
	Len() int
	Copy() Series
	Select(indexed []int) Series
	String() string

	GetBool(i int) bool
	SetBool(i int, v bool)

	GetNumber(i int) float64
	SetNumber(i int, v float64)

	GetString(i int) string
	SetString(i int, v string)

	IsNA(i int) bool
	SetNA(i int)
}

func NewBoolSeries

func NewBoolSeries(name string, nrow int) Series

func NewNumberSeries

func NewNumberSeries(name string, nrow int) Series

func NewPlaceholderSeries

func NewPlaceholderSeries(name string, nrow int) Series

func NewSeries

func NewSeries(t Type, name string, nrow int) Series

func NewStringSeries

func NewStringSeries(name string, nrow int) Series

type Type

type Type int
const (
	None Type = iota
	Bool
	Number
	String
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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