df

package
v0.6.0 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Len added in v0.5.0

func Len(s Series) int

Len returns the length of a given Series

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

Str prints some extra information about a given series

Types

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

CBind combines the columns of two DataFrames

func (DataFrame) Col added in v0.5.0

func (df DataFrame) Col(colname string) Series

Col returns the Series with the given column name contained in the DataFrame

func (DataFrame) ColIndex added in v0.6.0

func (d DataFrame) ColIndex(s string) int

ColIndex returns the index of the column with name `s`. If it fails to find the column it returns -1 instead.

func (DataFrame) Copy added in v0.5.0

func (df DataFrame) Copy() DataFrame

Copy wil copy the values of a given DataFrame

func (DataFrame) CrossJoin added in v0.6.0

func (a DataFrame) CrossJoin(b DataFrame) DataFrame

CrossJoin returns a DataFrame containing the cross join of two DataFrames. This operation matches all rows that appear on both dataframes.

func (DataFrame) Dim

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

Dim retrieves the dimensiosn of a DataFrame

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

Filter will filter the rows of a DataFrame

func (DataFrame) InnerJoin added in v0.6.0

func (a DataFrame) InnerJoin(b DataFrame, keys ...string) DataFrame

InnerJoin returns a DataFrame containing the inner join of two DataFrames. This operation matches all rows that appear on both dataframes.

func (DataFrame) LeftJoin added in v0.6.0

func (a DataFrame) LeftJoin(b DataFrame, keys ...string) DataFrame

LeftJoin returns a DataFrame containing the left join of two DataFrames. This operation matches all rows that appear on both dataframes.

func (DataFrame) Mutate added in v0.5.0

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

Mutate changes a column of the DataFrame with the given Series

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) OuterJoin added in v0.6.0

func (a DataFrame) OuterJoin(b DataFrame, keys ...string) DataFrame

OuterJoin returns a DataFrame containing the outer join of two DataFrames. This operation matches all rows that appear on both dataframes.

func (DataFrame) RBind added in v0.5.0

func (df DataFrame) RBind(newdf DataFrame) DataFrame

RBind combines the rows of two DataFrames

func (DataFrame) Rename added in v0.5.0

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

func (DataFrame) RightJoin added in v0.6.0

func (a DataFrame) RightJoin(b DataFrame, keys ...string) DataFrame

RightJoin returns a DataFrame containing the right join of two DataFrames. This operation matches all rows that appear on both dataframes.

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 F added in v0.5.0

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

F is the filtering structure

type Series added in v0.5.0

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

Series is the main structure for a series of elements of the same type. It is the primary building block of a DataFrame.

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(x interface{})

Append adds elements to the end of the Series

func (Series) Compare added in v0.5.0

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

Compare compares the values of a Series with other series, scalars, text, etc

func (Series) Concat added in v0.6.0

func (s Series) Concat(x Series) Series

Concat concatenates two series together

func (Series) Copy added in v0.5.0

func (s Series) Copy() Series

Copy wil copy the values of a given Series

func (Series) Empty added in v0.6.0

func (s Series) Empty() Series

Empty returns an empty Series of the same type

func (Series) Err added in v0.5.0

func (s Series) Err() error

Err returns the error contained in the series

func (Series) Records added in v0.5.0

func (s Series) Records() []string

Records returns the elements of a Series in a []string

func (Series) String added in v0.5.0

func (s Series) String() string

String implements the Stringer interface for Series

func (Series) Subset added in v0.5.0

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

Subset returns a subset of the series based on the given indexes

func (Series) Type added in v0.6.0

func (s Series) Type() string

Type returns the type of a given series

func (Series) Val added in v0.5.0

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

Val returns the value of a series for the given index or nil if NA or out of bounds

Jump to

Keyboard shortcuts

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