godf

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 12, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AutoCast

func AutoCast(data interface{}) any

func CastArrayFloat64

func CastArrayFloat64(data interface{}) []float64

func CastArrayInt

func CastArrayInt(data interface{}) []int

func CastArrayString

func CastArrayString(data interface{}) []string

func CastFloat64

func CastFloat64(data interface{}) float64

func CastHeaders

func CastHeaders(headers []string) []interface{}

func CastInt

func CastInt(data interface{}) int

func CastString

func CastString(data interface{}) string

func DataFrame

func DataFrame(data map[string]interface{}) *dataframe

DataFrame initializes and returns a dataframe

This function takes a map[string]interface{} as a variable where the string will be the header name and the interface{} will be the contained data

Returns a pointer to the dataframe

func GetDatatype added in v0.0.5

func GetDatatype(data interface{}) reflect.Kind

func ReadCSV

func ReadCSV(filename string) *dataframe

Types

type Eq added in v0.0.5

type Eq map[string]interface{}

Eq filter rows where a data in the given column is equal to given value

Example of usage:
df.Where(Eq{"x": 5})
will only get data with x = 5

type Filter added in v0.0.5

type Filter interface {
	// contains filtered or unexported methods
}

type GT added in v0.0.5

type GT map[string]interface{}

GT filter rows where a data in the given column is greater than the given value

Example of usage:
df.Where(GT{"x": 5})
will only get data with x > 5

type GTE added in v0.0.5

type GTE map[string]interface{}

GTE filter rows where a data in the given column is greater than or equal to the given value

Example of usage:
df.Where(GTE{"x": 5})
will only get data with x >= 5

type In added in v0.0.5

type In map[string]interface{}

In filter all data which value is in the given slice

Example of usage:
df.Where(In{"x": []int{1, 2, 3, 4}})
will only get data with x = [1, 2, 3, 4]

type LT added in v0.0.5

type LT map[string]interface{}

LT filter rows where a data in the given column is less than the given value

Example of usage:
df.Where(LT{"x": 5})
will only get data with x < 5

type LTE added in v0.0.5

type LTE map[string]interface{}

LTE filter rows where a data in the given column is less than or equal to the given value

Example of usage:
df.Where(LTE{"x": 5})
will only get data with x <= 5

type NotEq added in v0.0.5

type NotEq map[string]interface{}

NotEq filter rows where a data in the given column is not equal to given value

Example of usage:
df.Where(NotEq{"x": 5})
will get all data except the data with x = 5

Jump to

Keyboard shortcuts

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