df

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bools

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

Bools is a constructor for a bools array

func Floats

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

Floats is a constructor for a Float array

func Ints

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

Ints is a constructor for an Int array

func Strings

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

Strings is a constructor for a String array

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, error)

Bool returns the bool value of Bool

func (Bool) Checksum

func (b Bool) Checksum() [16]byte

Checksum generates a pseudo-unique 16 byte array

func (Bool) Float

func (b Bool) Float() (*float64, error)

Float returns the float value of Bool

func (Bool) Int

func (b Bool) Int() (*int, error)

Int returns the integer value of Bool

func (Bool) NA

func (b Bool) NA() bool

func (Bool) String

func (b Bool) String() string

type C

type C struct {
	Colname  string
	Elements cells
}

C represents a way to pass Colname and Elements to a DF constructor

type DataFrame

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

DataFrame is the base data structure

func Cbind

func Cbind(dfA DataFrame, dfB DataFrame) (*DataFrame, error)

Cbind combines the columns of two DataFrames

func New

func New(colConst ...C) (*DataFrame, error)

New is a constructor for DataFrames

func Rbind

func Rbind(dfA DataFrame, dfB DataFrame) (*DataFrame, error)

Rbind combines the rows of two dataframes

func (DataFrame) Dim

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

Dim will return the current dimensions of the DataFrame in a two element array where the first element is the number of rows and the second the number of columns.

func (DataFrame) Duplicated

func (df DataFrame) Duplicated() (*DataFrame, error)

Duplicated will return the first appearance of the duplicated rows in a DataFrame. The order of the rows will not be preserved.

func (*DataFrame) LoadAndParse

func (df *DataFrame) LoadAndParse(records [][]string, types interface{}) error

LoadAndParse will load the data from a multidimensional array of strings and parse it accordingly with the given types element. The types element can be a string array with matching dimensions to the number of columns or a DataFrame.T object.

func (*DataFrame) LoadData

func (df *DataFrame) LoadData(records [][]string) error

LoadData will load the data from a multidimensional array of strings into a DataFrame object.

func (DataFrame) Names

func (df DataFrame) Names() []string

Names is the getter method for the column names

func (DataFrame) RemoveDuplicated

func (df DataFrame) RemoveDuplicated() (*DataFrame, error)

RemoveDuplicated will return all unique rows in a DataFrame and the first appearance of all duplicated rows. The order of the rows will not be preserved.

func (DataFrame) RemoveUnique

func (df DataFrame) RemoveUnique() (*DataFrame, error)

RemoveUnique will return all duplicated rows inside a DataFrame

func (DataFrame) SaveRecords

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

SaveRecords will save data to records in [][]string format

func (*DataFrame) SetNames

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

SetNames let us specify the column names of a DataFrame

func (DataFrame) String

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

Implementing the Stringer interface for DataFrame

func (DataFrame) Subset

func (df DataFrame) Subset(subsetCols interface{}, subsetRows interface{}) (*DataFrame, error)

Subset will return a DataFrame that contains only the columns and rows contained on the given subset

func (DataFrame) SubsetColumns

func (df DataFrame) SubsetColumns(subset interface{}) (*DataFrame, error)

SubsetColumns will return a DataFrame that contains only the columns contained on the given subset

func (DataFrame) SubsetRows

func (df DataFrame) SubsetRows(subset interface{}) (*DataFrame, error)

SubsetRows will return a DataFrame that contains only the selected rows

func (DataFrame) Unique

func (df DataFrame) Unique() (*DataFrame, error)

Unique will return all unique rows inside a DataFrame. The order of the rows will not be preserved.

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) Bool

func (f Float) Bool() (*bool, error)

Bool returns the bool value of Float

func (Float) Checksum

func (f Float) Checksum() [16]byte

Checksum generates a pseudo-unique 16 byte array

func (Float) Float

func (f Float) Float() (*float64, error)

Float returns the float value of Float

func (Float) Int

func (f Float) Int() (*int, error)

Int returns the integer value of Float

func (Float) NA

func (f Float) NA() bool

func (Float) String

func (f Float) 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, error)

Bool returns the bool value of Int

func (Int) Checksum

func (i Int) Checksum() [16]byte

Checksum generates a pseudo-unique 16 byte array

func (Int) Float

func (i Int) Float() (*float64, error)

Float returns the float value of Int

func (Int) Int

func (i Int) Int() (*int, error)

Int returns the integer value of Int

func (Int) NA

func (i Int) NA() bool

func (Int) String

func (i Int) String() string

type R

type R struct {
	From int
	To   int
}

R represent a range from a number to another

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, error)

Bool returns the bool value of String

func (String) Checksum

func (s String) Checksum() [16]byte

Checksum generates a pseudo-unique 16 byte array

func (String) Float

func (s String) Float() (*float64, error)

Float returns the float value of String

func (String) Int

func (s String) Int() (*int, error)

Int returns the integer value of String

func (String) NA

func (s String) NA() bool

func (String) String

func (s String) String() string

type T

type T map[string]string

T is used to represent the association between a column and it't type

Jump to

Keyboard shortcuts

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