df

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2016 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Addr added in v0.5.0

func Addr(s Series) []string

func Len added in v0.5.0

func Len(s Series) int

func Range added in v0.5.0

func Range(start, end int) []int

func Seq added in v0.5.0

func Seq(start, end, step int) []int

func Str added in v0.5.0

func Str(s Series) string

Extra Series functions

func Type added in v0.5.0

func Type(s Series) string

Types

type Bool

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

Bool is an alias for string to be able to implement custom methods

func (Bool) Bool

func (b Bool) Bool() *bool

Bool returns the bool value of Bool

func (Bool) Copy added in v0.4.0

func (b Bool) Copy() Bool

func (Bool) Float

func (b Bool) Float() *float64

Float returns the float value of Bool

func (Bool) Int

func (b Bool) Int() *int

Int returns the integer value of Bool

func (Bool) IsNA added in v0.4.0

func (b Bool) IsNA() bool

IsNA returns true if the element is empty and viceversa

func (Bool) String

func (b Bool) String() string

type BoolElements added in v0.5.0

type BoolElements []Bool

func (BoolElements) Copy added in v0.5.0

func (s BoolElements) Copy() Elements

func (BoolElements) Records added in v0.5.0

func (s BoolElements) Records() []string

func (BoolElements) String added in v0.5.0

func (s BoolElements) String() string

type DataFrame

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

DataFrame is the base data structure

func New

func New(series ...Series) DataFrame

New is a constructor for DataFrames

func ReadCSV added in v0.5.0

func ReadCSV(str string, types ...string) DataFrame

func ReadJSON added in v0.5.0

func ReadJSON(r io.Reader, types ...string) DataFrame

func ReadJSONString added in v0.5.0

func ReadJSONString(str string, types ...string) DataFrame

func ReadMaps added in v0.5.0

func ReadMaps(maps []map[string]interface{}, types ...string) DataFrame

func ReadRecords added in v0.5.0

func ReadRecords(records [][]string, types ...string) DataFrame

func (DataFrame) CBind added in v0.5.0

func (df DataFrame) CBind(newdf DataFrame) DataFrame

TODO: Expand to accept DataFrames, Series, and potentially other objects

func (DataFrame) Col added in v0.5.0

func (df DataFrame) Col(colname string) Series

TODO: Accept also an int with the position of the Series

func (DataFrame) Copy added in v0.5.0

func (df DataFrame) Copy() DataFrame

func (DataFrame) Dim

func (df DataFrame) Dim() (dim [2]int)

func (DataFrame) Err added in v0.5.0

func (df DataFrame) Err() error

func (DataFrame) Filter added in v0.5.0

func (df DataFrame) Filter(filters ...F) DataFrame

TODO: Implement a better interface for filtering

func (DataFrame) Mutate added in v0.5.0

func (df DataFrame) Mutate(colname string, series Series) DataFrame

func (DataFrame) Names

func (df DataFrame) Names() []string

func (DataFrame) Ncol added in v0.5.0

func (df DataFrame) Ncol() int

NCols is the getter method for the number of rows in a DataFrame

func (DataFrame) Nrow added in v0.5.0

func (df DataFrame) Nrow() int

NRows is the getter method for the number of rows in a DataFrame

func (DataFrame) RBind added in v0.5.0

func (df DataFrame) RBind(newdf DataFrame) DataFrame

TODO: Expand to accept DataFrames, Series, and potentially other objects

func (DataFrame) Rename added in v0.5.0

func (df DataFrame) Rename(newname, oldname string) DataFrame

func (DataFrame) SaveCSV added in v0.5.0

func (df DataFrame) SaveCSV() ([]byte, error)

func (DataFrame) SaveJSON added in v0.5.0

func (df DataFrame) SaveJSON() ([]byte, error)

func (DataFrame) SaveMaps added in v0.5.0

func (df DataFrame) SaveMaps() []map[string]interface{}

func (DataFrame) SaveRecords

func (df DataFrame) SaveRecords() [][]string

func (DataFrame) Select added in v0.5.0

func (df DataFrame) Select(colnames ...string) DataFrame

Select the given DataFrame columns

func (DataFrame) SetNames

func (df DataFrame) SetNames(colnames []string) error

func (DataFrame) String

func (df DataFrame) String() (str string)

String implements the Stringer interface for DataFrame

func (DataFrame) Subset

func (df DataFrame) Subset(indexes interface{}) DataFrame

Subsets the DataFrame based on the Series subsetting rules

func (DataFrame) Types added in v0.5.0

func (df DataFrame) Types() []string

type Elements added in v0.5.0

type Elements interface {
	Copy() Elements
	Records() []string
}

type F added in v0.5.0

type F struct {
	Colname    string
	Comparator string
	Comparando interface{}
}

type Float

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

Float is an alias for float64 to be able to implement custom methods

func (Float) Copy added in v0.4.0

func (f Float) Copy() Float

func (Float) Float

func (f Float) Float() *float64

Float returns the float value of Float

func (Float) Int

func (f Float) Int() *int

Int returns the integer value of Float

func (Float) IsNA added in v0.4.0

func (f Float) IsNA() bool

IsNA returns true if the element is empty and viceversa

func (Float) String

func (f Float) String() string

type FloatElements added in v0.5.0

type FloatElements []Float

func (FloatElements) Copy added in v0.5.0

func (s FloatElements) Copy() Elements

func (FloatElements) Records added in v0.5.0

func (s FloatElements) Records() []string

func (FloatElements) String added in v0.5.0

func (s FloatElements) String() string

type Int

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

Int is an alias for int to be able to implement custom methods

func (Int) Bool

func (i Int) Bool() *bool

Bool returns the bool value of Int

func (Int) Copy added in v0.4.0

func (i Int) Copy() Int

func (Int) Float

func (i Int) Float() *float64

Float returns the float value of Int

func (Int) Int

func (i Int) Int() *int

Int returns the integer value of Int

func (Int) IsNA added in v0.4.0

func (i Int) IsNA() bool

IsNA returns true if the element is empty and viceversa

func (Int) String

func (i Int) String() string

type IntElements added in v0.5.0

type IntElements []Int

func (IntElements) Copy added in v0.5.0

func (s IntElements) Copy() Elements

func (IntElements) Records added in v0.5.0

func (s IntElements) Records() []string

func (IntElements) String added in v0.5.0

func (s IntElements) String() string

type Series added in v0.5.0

type Series struct {
	Name     string   // The name of the series
	Elements Elements // The values of the elements
	// contains filtered or unexported fields
}

TODO: Refactor error returns

func Bools

func Bools(args ...interface{}) Series

Bools is a constructor for a bools series

func Floats

func Floats(args ...interface{}) Series

Floats is a constructor for a Float series

func Ints

func Ints(args ...interface{}) Series

Ints is a constructor for an Int series

func NamedBools added in v0.5.0

func NamedBools(name string, args ...interface{}) Series

NamedBools is a constructor for a named Bool series

func NamedFloats added in v0.5.0

func NamedFloats(name string, args ...interface{}) Series

NamedFloats is a constructor for a named Float series

func NamedInts added in v0.5.0

func NamedInts(name string, args ...interface{}) Series

NamedInts is a constructor for a named Int series

func NamedStrings added in v0.5.0

func NamedStrings(name string, args ...interface{}) Series

NamedStrings is a constructor for a named String series

func Strings

func Strings(args ...interface{}) Series

Strings is a constructor for a String series

func (Series) Append added in v0.5.0

func (s Series) Append(newSeries Series) Series

func (Series) Compare added in v0.5.0

func (s Series) Compare(comparator string, comparando interface{}) ([]bool, error)

TODO: Return a Bools Series instead of []bool?

func (Series) Copy added in v0.5.0

func (s Series) Copy() Series

func (Series) Err added in v0.5.0

func (s Series) Err() error

func (Series) Records added in v0.5.0

func (s Series) Records() []string

func (Series) String added in v0.5.0

func (s Series) String() string

func (Series) Subset added in v0.5.0

func (s Series) Subset(indexes interface{}) (Series, error)

func (Series) Val added in v0.5.0

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

type String

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

String is an alias for string to be able to implement custom methods

func (String) Bool

func (s String) Bool() *bool

All Bool() methods ==================== Bool returns the bool value of String

func (String) Copy added in v0.4.0

func (s String) Copy() String

func (String) Float

func (s String) Float() *float64

Float returns the float value of String

func (String) Int

func (s String) Int() *int

Int returns the integer value of String

func (String) IsNA added in v0.4.0

func (s String) IsNA() bool

IsNA returns true if the element is empty and viceversa

func (String) String

func (s String) String() string

type StringElements added in v0.5.0

type StringElements []String

func (StringElements) Copy added in v0.5.0

func (s StringElements) Copy() Elements

func (StringElements) Records added in v0.5.0

func (s StringElements) Records() []string

func (StringElements) String added in v0.5.0

func (s StringElements) String() string

Jump to

Keyboard shortcuts

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