gandalff

package module
v0.0.0-...-aa5a87f Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 21 Imported by: 0

README

GANDALFF: Golang, ANother DatAframe Library For Fun 🧙‍♂️

Or, for short, GDL: Golang Dataframe Library

What is it?

Gandalff is a library for data wrangling in Go. The goal is to provide a simple and efficient API for data manipulation in Go, similar to Pandas or Polars in Python, and Dplyr in R. It supports nullable types: null data is optimized for memory usage.

Gandalff is a work in progress, and the API is not stable yet. However, it already supports the following formats:

  • CSV
  • XPT (SAS)
  • XLSX
  • HTML
  • Markdown

Examples

package main

import (
	"strings"

	gandalff "github.com/caerbannogwhite/gandalff"
)

func main() {
	data1 := `
name,age,weight,junior,department,salary band
Alice C,29,75.0,F,HR,4
John Doe,30,80.5,true,IT,2
Bob,31,85.0,F,IT,4
Jane H,25,60.0,false,IT,4
Mary,28,70.0,false,IT,3
Oliver,32,90.0,true,HR,1
Ursula,27,65.0,f,Business,4
Charlie,33,60.0,t,Business,2
Megan,26,55.0,F,IT,3
`

	gandalff.NewBaseDataFrame(gandalff.NewContext()).
		FromCsv().
		SetReader(strings.NewReader(data1)).
		Read().
		Select("department", "age", "weight", "junior").
		GroupBy("department").
		Agg(gandalff.Min("age"), gandalff.Max("weight"), gandalff.Mean("junior"), gandalff.Count()).
    Run().
		PrettyPrint(
      gandalff.NewPrettyPrintParams().
			  SetUseLipGloss(true))
}

// Output:
// ╭────────────┬─────────┬─────────┬─────────┬───────╮
// │ department │ age     │ weight  │ junior  │ n     │
// ├────────────┼─────────┼─────────┼─────────┼───────┤
// │ String     │ Float64 │ Float64 │ Float64 │ Int64 │
// ├────────────┼─────────┼─────────┼─────────┼───────┤
// │ HR         │   29.00 │   90.00 │  0.5000 │ 2.000 │
// │ IT         │   25.00 │   85.00 │  0.5000 │ 4.000 │
// │ Business   │   27.00 │   65.00 │  0.5000 │ 2.000 │
// ╰────────────┴─────────┴─────────┴─────────┴───────╯

Community

You can join the Gandalff community on Discord.

Supported data types

The data types not checked are not yet supported, but might be in the future.

  • Bool
  • Bool (memory optimized, not fully implemented yet)
  • Int16
  • Int
  • Int64
  • Float32
  • Float64
  • Complex64
  • Complex128
  • String
  • Time
  • Duration

Supported operations for Series

  • Filter

    • filter by bool slice
    • filter by int slice
    • filter by bool series
    • filter by int series
  • Group

    • Group (with nulls)
    • SubGroup (with nulls)
  • Map

  • Sort

    • Sort (with nulls)
    • SortRev (with nulls)
  • Take

Supported operations for DataFrame

  • Agg

  • Filter

  • GroupBy

  • Join

    • Inner
    • Left
    • Right
    • Outer
    • Inner with nulls
    • Left with nulls
    • Right with nulls
    • Outer with nulls
  • Map

  • OrderBy

  • Select

  • Take

  • Pivot

  • Stack/Append

Supported stats functions

  • Count
  • Sum
  • Mean
  • Median
  • Min
  • Max
  • StdDev
  • Variance
  • Quantile

Dependencies

Built with:

TODO

  • Improve filtering interface.
  • Improve dataframe PrettyPrint: add parameters, optimize data display, use lipgloss.
  • Implement string factors.
  • SeriesTime: set time format.
  • Implement Set(i []int, v []any) Series.
  • Add Slice(i []int) Series (using filter?).
  • Implement memory optimized Bool series with uint64.
  • Use uint64 for null mask.
  • Optimize XPT reader/writer with float32.
  • Add url resolver to each reader.
  • Add format option to each writer.
  • JSON reader by records.
  • Implement chunked series.
  • Implement OpenAI interface.
  • Implement Parquet reader and writer.
  • Implement SPSS reader and writer.
  • Implement SAS7BDAT reader and writer (https://cran.r-project.org/web/packages/sas7bdat/vignettes/sas7bdat.pdf)

Documentation

Index

Constants

View Source
const (
	// The default capacity of a series.
	DEFAULT_SERIES_INITIAL_CAPACITY = 10

	// The default capacity of a hash map.
	DEFAULT_HASH_MAP_INITIAL_CAPACITY = 1024

	// The default capacity of a dense map array.
	DEFAULT_DENSE_MAP_ARRAY_INITIAL_CAPACITY = 64

	// Number of threads to use for parallel operations.
	THREADS_NUMBER = 16

	// Minimum number of elements to use parallel operations.
	MINIMUM_PARALLEL_SIZE_1 = 16_384
	MINIMUM_PARALLEL_SIZE_2 = 131_072

	HASH_MAGIC_NUMBER      = int64(0xa8f4979b77e3f93)
	HASH_MAGIC_NUMBER_NULL = int64(0x7fff4979b77e3f93)
	HASH_NULL_KEY          = int64(0x7ff8000000000001)

	INF_TEXT        = "Inf"
	NA_TEXT         = "Na"
	BOOL_TRUE_TEXT  = "true"
	BOOL_FALSE_TEXT = "false"

	CSV_READER_DEFAULT_DELIMITER           = ','
	CSV_READER_DEFAULT_HEADER              = true
	CSV_READER_DEFAULT_GUESS_DATA_TYPE_LEN = 1000

	XLSX_READER_DEFAULT_GUESS_DATA_TYPE_LEN = 1000
)
View Source
const DEFAULT_COUNT_NAME = "n"

Variables

View Source
var SpecialMissingValueRegex = regexp.MustCompile("^[A-Z_]\x00\x00\x00\x00\x00\x00\x00$")

Functions

func Count

func Count() aggregator

func DivMod

func DivMod(n, d int64) (q, r int64)

Python divmod build-in for Go.

func IsIbmSpecialMissingValue

func IsIbmSpecialMissingValue(ieee float64) bool

Check if float is a SpecialMissingValue from an XPORT-format bytestring.

func Max

func Max(name string) aggregator

func Mean

func Mean(name string) aggregator

func Median

func Median(name string) aggregator

func Min

func Min(name string) aggregator

func NewNamestrV56

func NewNamestrV56() *__NAMESTRv56

func NewNamestrV89

func NewNamestrV89() *__NAMESTRv89

func Std

func Std(name string) aggregator

func Sum

func Sum(name string) aggregator

Types

type AggregateType

type AggregateType int8
const (
	AGGREGATE_COUNT AggregateType = iota
	AGGREGATE_SUM
	AGGREGATE_MEAN
	AGGREGATE_MEDIAN
	AGGREGATE_MIN
	AGGREGATE_MAX
	AGGREGATE_STD
)

type BaseDataFrame

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

func (BaseDataFrame) AddSeries

func (df BaseDataFrame) AddSeries(name string, series Series) DataFrame

func (BaseDataFrame) AddSeriesFromBools

func (df BaseDataFrame) AddSeriesFromBools(name string, data []bool, nullMask []bool, makeCopy bool) DataFrame

func (BaseDataFrame) AddSeriesFromDurations

func (df BaseDataFrame) AddSeriesFromDurations(name string, data []time.Duration, nullMask []bool, makeCopy bool) DataFrame

func (BaseDataFrame) AddSeriesFromFloat64s

func (df BaseDataFrame) AddSeriesFromFloat64s(name string, data []float64, nullMask []bool, makeCopy bool) DataFrame

func (BaseDataFrame) AddSeriesFromInt64s

func (df BaseDataFrame) AddSeriesFromInt64s(name string, data []int64, nullMask []bool, makeCopy bool) DataFrame

func (BaseDataFrame) AddSeriesFromInts

func (df BaseDataFrame) AddSeriesFromInts(name string, data []int, nullMask []bool, makeCopy bool) DataFrame

func (BaseDataFrame) AddSeriesFromStrings

func (df BaseDataFrame) AddSeriesFromStrings(name string, data []string, nullMask []bool, makeCopy bool) DataFrame

func (BaseDataFrame) AddSeriesFromTimes

func (df BaseDataFrame) AddSeriesFromTimes(name string, data []time.Time, nullMask []bool, makeCopy bool) DataFrame

func (BaseDataFrame) Agg

func (df BaseDataFrame) Agg(aggregators ...aggregator) aggregatorBuilder

func (BaseDataFrame) At

func (df BaseDataFrame) At(index int) Series

Returns the series at the given index.

func (BaseDataFrame) C

func (df BaseDataFrame) C(name string) Series

Returns the column with the given name.

func (BaseDataFrame) Describe

func (df BaseDataFrame) Describe() string

func (BaseDataFrame) Filter

func (df BaseDataFrame) Filter(mask any) DataFrame

func (BaseDataFrame) FromCsv

func (df BaseDataFrame) FromCsv() *CsvReader

func (BaseDataFrame) FromJson

func (df BaseDataFrame) FromJson() *JsonReader

func (BaseDataFrame) FromXlsx

func (df BaseDataFrame) FromXlsx() *XlsxReader

func (BaseDataFrame) FromXpt

func (df BaseDataFrame) FromXpt() *XptReader

func (BaseDataFrame) GetContext

func (df BaseDataFrame) GetContext() *Context

GetContext returns the context of the dataframe.

func (BaseDataFrame) GetError

func (df BaseDataFrame) GetError() error

func (BaseDataFrame) GetSeriesIndex

func (df BaseDataFrame) GetSeriesIndex(name string) int

func (BaseDataFrame) GroupBy

func (df BaseDataFrame) GroupBy(by ...string) DataFrame

func (BaseDataFrame) IsErrored

func (df BaseDataFrame) IsErrored() bool

func (BaseDataFrame) IsGrouped

func (df BaseDataFrame) IsGrouped() bool

func (BaseDataFrame) Join

func (df BaseDataFrame) Join(how DataFrameJoinType, other DataFrame, on ...string) DataFrame

func (BaseDataFrame) Len

func (df BaseDataFrame) Len() int

func (BaseDataFrame) Less

func (df BaseDataFrame) Less(i, j int) bool

func (BaseDataFrame) NCols

func (df BaseDataFrame) NCols() int

NCols returns the number of columns in the dataframe.

func (BaseDataFrame) NRows

func (df BaseDataFrame) NRows() int

NRows returns the number of rows in the dataframe.

func (BaseDataFrame) NameAt

func (df BaseDataFrame) NameAt(index int) string

Returns the series with the given name as a bool series.

func (BaseDataFrame) Names

func (df BaseDataFrame) Names() []string

Names returns the names of the series in the dataframe.

func (BaseDataFrame) OrderBy

func (df BaseDataFrame) OrderBy(params ...SortParam) DataFrame

func (BaseDataFrame) PPrint

func (df BaseDataFrame) PPrint(params PPrintParams) DataFrame

Pretty print the dataframe.

func (BaseDataFrame) Records

func (df BaseDataFrame) Records(header bool) [][]string

func (BaseDataFrame) Replace

func (df BaseDataFrame) Replace(name string, s Series) DataFrame

func (BaseDataFrame) Select

func (df BaseDataFrame) Select(selectors ...string) DataFrame

func (BaseDataFrame) SelectAt

func (df BaseDataFrame) SelectAt(indices ...int) DataFrame

func (BaseDataFrame) Swap

func (df BaseDataFrame) Swap(i, j int)

func (BaseDataFrame) Take

func (df BaseDataFrame) Take(params ...int) DataFrame

func (BaseDataFrame) ToCsv

func (df BaseDataFrame) ToCsv() *CsvWriter

func (BaseDataFrame) ToHtml

func (df BaseDataFrame) ToHtml() *HtmlWriter

func (BaseDataFrame) ToJson

func (df BaseDataFrame) ToJson() *JsonWriter

func (BaseDataFrame) ToMarkDown

func (df BaseDataFrame) ToMarkDown() *MarkDownWriter

func (BaseDataFrame) ToXlsx

func (df BaseDataFrame) ToXlsx() *XlsxWriter

func (BaseDataFrame) ToXpt

func (df BaseDataFrame) ToXpt() *XptWriter

func (BaseDataFrame) Types

func (df BaseDataFrame) Types() []preludiometa.BaseType

Types returns the types of the series in the dataframe.

func (BaseDataFrame) Ungroup

func (df BaseDataFrame) Ungroup() DataFrame

type BaseDataFramePartitionEntry

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

type Context

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

func NewContext

func NewContext() *Context

func (*Context) GetNaText

func (ctx *Context) GetNaText() string

func (*Context) GetThreadsNumber

func (ctx *Context) GetThreadsNumber() int

func (*Context) GetTimeFormat

func (ctx *Context) GetTimeFormat() string

func (*Context) SetNaText

func (ctx *Context) SetNaText(s string) *Context

func (*Context) SetThreadsNumber

func (ctx *Context) SetThreadsNumber(n int) *Context

func (*Context) SetTimeFormat

func (ctx *Context) SetTimeFormat(s string) *Context

type CsvReader

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

func NewCsvReader

func NewCsvReader(ctx *Context) *CsvReader

func (*CsvReader) Read

func (r *CsvReader) Read() DataFrame

func (*CsvReader) SetContext

func (r *CsvReader) SetContext(ctx *Context) *CsvReader

func (*CsvReader) SetDelimiter

func (r *CsvReader) SetDelimiter(delimiter rune) *CsvReader

func (*CsvReader) SetGuessDataTypeLen

func (r *CsvReader) SetGuessDataTypeLen(guessDataTypeLen int) *CsvReader

func (*CsvReader) SetHeader

func (r *CsvReader) SetHeader(header bool) *CsvReader

func (*CsvReader) SetNullValues

func (r *CsvReader) SetNullValues(nullValues bool) *CsvReader

func (*CsvReader) SetPath

func (r *CsvReader) SetPath(path string) *CsvReader

func (*CsvReader) SetReader

func (r *CsvReader) SetReader(reader io.Reader) *CsvReader

func (*CsvReader) SetRows

func (r *CsvReader) SetRows(rows int) *CsvReader

func (*CsvReader) SetSchema

func (r *CsvReader) SetSchema(schema *preludiometa.Schema) *CsvReader

type CsvWriter

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

func NewCsvWriter

func NewCsvWriter() *CsvWriter

func (*CsvWriter) SetDataFrame

func (w *CsvWriter) SetDataFrame(dataframe DataFrame) *CsvWriter

func (*CsvWriter) SetDelimiter

func (w *CsvWriter) SetDelimiter(delimiter rune) *CsvWriter

func (*CsvWriter) SetFormat

func (w *CsvWriter) SetFormat(format bool) *CsvWriter

func (*CsvWriter) SetHeader

func (w *CsvWriter) SetHeader(header bool) *CsvWriter

func (*CsvWriter) SetNaText

func (w *CsvWriter) SetNaText(naText string) *CsvWriter

func (*CsvWriter) SetPath

func (w *CsvWriter) SetPath(path string) *CsvWriter

func (*CsvWriter) SetWriter

func (w *CsvWriter) SetWriter(writer io.Writer) *CsvWriter

func (*CsvWriter) Write

func (w *CsvWriter) Write() DataFrame

type DataFrame

type DataFrame interface {

	// GetContext returns the context of the dataframe.
	GetContext() *Context

	// Names returns the names of the series in the dataframe.
	Names() []string
	// Types returns the types of the series in the dataframe.
	Types() []preludiometa.BaseType
	// NCols returns the number of columns in the dataframe.
	NCols() int
	// NRows returns the number of rows in the dataframe.
	NRows() int

	IsErrored() bool

	IsGrouped() bool

	GetError() error

	GetSeriesIndex(name string) int

	// AddSeries adds a generic series to the dataframe.
	AddSeries(name string, series Series) DataFrame
	// AddSeriesFromBools adds a series of bools to the dataframe.
	AddSeriesFromBools(name string, data []bool, nullMask []bool, makeCopy bool) DataFrame
	// AddSeriesFromInt32s adds a series of ints to the dataframe.
	AddSeriesFromInts(name string, data []int, nullMask []bool, makeCopy bool) DataFrame
	// AddSeriesFromInt64s adds a series of ints to the dataframe.
	AddSeriesFromInt64s(name string, data []int64, nullMask []bool, makeCopy bool) DataFrame
	// AddSeriesFromFloat64s adds a series of floats to the dataframe.
	AddSeriesFromFloat64s(name string, data []float64, nullMask []bool, makeCopy bool) DataFrame
	// AddSeriesFromStrings adds a series of strings to the dataframe.
	AddSeriesFromStrings(name string, data []string, nullMask []bool, makeCopy bool) DataFrame
	// AddSeriesFromTimes adds a series of times to the dataframe.
	AddSeriesFromTimes(name string, data []time.Time, nullMask []bool, makeCopy bool) DataFrame
	// AddSeriesFromDurations adds a series of durations to the dataframe.
	AddSeriesFromDurations(name string, data []time.Duration, nullMask []bool, makeCopy bool) DataFrame

	// Replace the series with the given name.
	Replace(name string, s Series) DataFrame

	// Returns the column with the given name.
	C(name string) Series

	// Returns the series at the given index.
	At(index int) Series

	// Returns the series with the given name as a bool series.
	NameAt(index int) string

	Select(selectors ...string) DataFrame

	SelectAt(indices ...int) DataFrame

	Filter(mask any) DataFrame

	GroupBy(by ...string) DataFrame

	Ungroup() DataFrame

	Join(how DataFrameJoinType, other DataFrame, on ...string) DataFrame

	Take(params ...int) DataFrame

	Agg(aggregators ...aggregator) aggregatorBuilder

	// Sort the dataframe.
	Len() int
	Less(i, j int) bool
	Swap(i, j int)
	OrderBy(params ...SortParam) DataFrame

	Describe() string
	Records(header bool) [][]string

	// Pretty print the dataframe.
	PPrint(params PPrintParams) DataFrame

	FromCsv() *CsvReader
	ToCsv() *CsvWriter

	FromJson() *JsonReader
	ToJson() *JsonWriter

	FromXpt() *XptReader
	ToXpt() *XptWriter

	FromXlsx() *XlsxReader
	ToXlsx() *XlsxWriter

	ToHtml() *HtmlWriter
	ToMarkDown() *MarkDownWriter
	// contains filtered or unexported methods
}

func NewBaseDataFrame

func NewBaseDataFrame(ctx *Context) DataFrame

type DataFrameJoinType

type DataFrameJoinType int8
const (
	INNER_JOIN DataFrameJoinType = iota
	LEFT_JOIN
	RIGHT_JOIN
	OUTER_JOIN
)

type Formatter

type Formatter interface {
	Compute()
	GetMaxWidth() int
	Push(val any)
	Format(width int, val any, isNa bool) string
}

type HtmlWriter

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

func NewHtmlWriter

func NewHtmlWriter() *HtmlWriter

func (*HtmlWriter) SetDataFrame

func (w *HtmlWriter) SetDataFrame(dataframe DataFrame) *HtmlWriter

func (*HtmlWriter) SetDatatables

func (w *HtmlWriter) SetDatatables(datatables bool) *HtmlWriter

func (*HtmlWriter) SetIndent

func (w *HtmlWriter) SetIndent(indent string) *HtmlWriter

func (*HtmlWriter) SetNaText

func (w *HtmlWriter) SetNaText(naText string) *HtmlWriter

func (*HtmlWriter) SetNewLine

func (w *HtmlWriter) SetNewLine(newLine string) *HtmlWriter

func (*HtmlWriter) SetPath

func (w *HtmlWriter) SetPath(path string) *HtmlWriter

func (*HtmlWriter) SetWriter

func (w *HtmlWriter) SetWriter(writer io.Writer) *HtmlWriter

func (*HtmlWriter) Write

func (w *HtmlWriter) Write() DataFrame

type JsonReader

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

func NewJsonReader

func NewJsonReader(ctx *Context) *JsonReader

func (*JsonReader) Read

func (r *JsonReader) Read() DataFrame

func (*JsonReader) SetPath

func (r *JsonReader) SetPath(path string) *JsonReader

func (*JsonReader) SetReader

func (r *JsonReader) SetReader(reader io.Reader) *JsonReader

func (*JsonReader) SetSchema

func (r *JsonReader) SetSchema(schema *preludiometa.Schema) *JsonReader

type JsonWriter

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

func NewJsonWriter

func NewJsonWriter() *JsonWriter

func (*JsonWriter) SetDataFrame

func (w *JsonWriter) SetDataFrame(dataframe DataFrame) *JsonWriter

func (*JsonWriter) SetIndent

func (w *JsonWriter) SetIndent(indent string) *JsonWriter

func (*JsonWriter) SetNewLine

func (w *JsonWriter) SetNewLine(newLine string) *JsonWriter

func (*JsonWriter) SetPath

func (w *JsonWriter) SetPath(path string) *JsonWriter

func (*JsonWriter) SetWriter

func (w *JsonWriter) SetWriter(writer io.Writer) *JsonWriter

func (*JsonWriter) Write

func (w *JsonWriter) Write() DataFrame

type MapFunc

type MapFunc func(v any) any

type MapFuncNull

type MapFuncNull func(v any, isNull bool) (any, bool)

type MarkDownWriter

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

func NewMarkDownWriter

func NewMarkDownWriter() *MarkDownWriter

func (*MarkDownWriter) SetDataFrame

func (w *MarkDownWriter) SetDataFrame(dataframe DataFrame) *MarkDownWriter

func (*MarkDownWriter) SetHeader

func (w *MarkDownWriter) SetHeader(header bool) *MarkDownWriter

func (*MarkDownWriter) SetIndex

func (w *MarkDownWriter) SetIndex(index bool) *MarkDownWriter

func (*MarkDownWriter) SetNaText

func (w *MarkDownWriter) SetNaText(naText string) *MarkDownWriter

func (*MarkDownWriter) SetPath

func (w *MarkDownWriter) SetPath(path string) *MarkDownWriter

func (*MarkDownWriter) SetWriter

func (w *MarkDownWriter) SetWriter(writer io.Writer) *MarkDownWriter

func (*MarkDownWriter) Write

func (w *MarkDownWriter) Write() DataFrame

type NullableBool

type NullableBool struct {
	Valid bool
	Value bool
}

type NullableDuration

type NullableDuration struct {
	Valid bool
	Value time.Duration
}

type NullableFloat32

type NullableFloat32 struct {
	Valid bool
	Value float32
}

type NullableFloat64

type NullableFloat64 struct {
	Valid bool
	Value float64
}

type NullableInt

type NullableInt struct {
	Valid bool
	Value int
}

type NullableInt16

type NullableInt16 struct {
	Valid bool
	Value int16
}

type NullableInt32

type NullableInt32 struct {
	Valid bool
	Value int32
}

type NullableInt64

type NullableInt64 struct {
	Valid bool
	Value int64
}

type NullableInt8

type NullableInt8 struct {
	Valid bool
	Value int8
}

type NullableString

type NullableString struct {
	Valid bool
	Value string
}

type NullableTime

type NullableTime struct {
	Valid bool
	Value time.Time
}

type NumericFormatter

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

func NewNumericFormatter

func NewNumericFormatter() *NumericFormatter

func (*NumericFormatter) Compute

func (f *NumericFormatter) Compute()

func (*NumericFormatter) Format

func (f *NumericFormatter) Format(width int, val any, isNa bool) string

func (*NumericFormatter) GetMaxWidth

func (f *NumericFormatter) GetMaxWidth() int

func (*NumericFormatter) Push

func (f *NumericFormatter) Push(val any)

func (*NumericFormatter) SetDecimalDigits

func (f *NumericFormatter) SetDecimalDigits(decimalDigits int) *NumericFormatter

func (*NumericFormatter) SetInfText

func (f *NumericFormatter) SetInfText(infText string) *NumericFormatter

func (*NumericFormatter) SetJustifyLeft

func (f *NumericFormatter) SetJustifyLeft(justifyLeft bool) *NumericFormatter

func (*NumericFormatter) SetMaxDigits

func (f *NumericFormatter) SetMaxDigits(maxDigits int) *NumericFormatter

func (*NumericFormatter) SetMovingDigits

func (f *NumericFormatter) SetMovingDigits(movingDigits int) *NumericFormatter

func (*NumericFormatter) SetNaText

func (f *NumericFormatter) SetNaText(naText string) *NumericFormatter

func (*NumericFormatter) SetScientificThreshold

func (f *NumericFormatter) SetScientificThreshold(scientificThreshold int) *NumericFormatter

func (*NumericFormatter) SetThreshold

func (f *NumericFormatter) SetThreshold(threshold int) *NumericFormatter

func (*NumericFormatter) SetTruncateOutput

func (f *NumericFormatter) SetTruncateOutput(truncateOutput bool) *NumericFormatter

func (*NumericFormatter) SetUseLipGloss

func (f *NumericFormatter) SetUseLipGloss(useLipGloss bool) *NumericFormatter

type PPrintParams

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

func NewPPrintParams

func NewPPrintParams() PPrintParams

func (PPrintParams) SetIndent

func (ppp PPrintParams) SetIndent(s string) PPrintParams

func (PPrintParams) SetIndex

func (ppp PPrintParams) SetIndex(b bool) PPrintParams

func (PPrintParams) SetMaxColWidth

func (ppp PPrintParams) SetMaxColWidth(n int) PPrintParams

func (PPrintParams) SetMinColWidth

func (ppp PPrintParams) SetMinColWidth(n int) PPrintParams

func (PPrintParams) SetNRows

func (ppp PPrintParams) SetNRows(n int) PPrintParams

func (PPrintParams) SetTailLen

func (ppp PPrintParams) SetTailLen(n int) PPrintParams

func (PPrintParams) SetUseLipGloss

func (ppp PPrintParams) SetUseLipGloss(b bool) PPrintParams

func (PPrintParams) SetWidth

func (ppp PPrintParams) SetWidth(n int) PPrintParams

type RowDataProvider

type RowDataProvider interface {
	Read() ([]string, error)
}

type SasFloat

type SasFloat []byte

SAS float numbers.

SAS supports 27 special missing values, allowing the categorization of missing data by tagging or labeling missing values using the letters A to Z or an underscore.

func NewSasFloat

func NewSasFloat(b []byte) *SasFloat

func (*SasFloat) FromIeee

func (sf *SasFloat) FromIeee(ieee float64, byteOrder binary.ByteOrder) error

Convert Python floating point numbers to IBM-format (bytes).

func (*SasFloat) ToIeee

func (sf *SasFloat) ToIeee(byteOrder binary.ByteOrder) (float64, error)

Convert IBM-format floating point (bytes) to IEEE 754 64-bit (float).

type Series

type Series interface {

	// Return the context of the series.
	GetContext() *Context
	// Return the number of elements in the series.
	Len() int
	// Return the type of the series.
	Type() preludiometa.BaseType
	// Return the type and cardinality of the series.
	TypeCard() preludiometa.BaseTypeCard
	// Return if the series is grouped.
	IsGrouped() bool
	// Return if the series admits null values.
	IsNullable() bool
	// Return if the series is sorted.
	IsSorted() SeriesSortOrder
	// Return if the series is error.
	IsError() bool
	// Return the error message of the series.
	GetError() string

	// Return if the series has null values.
	HasNull() bool
	// Return the number of null values in the series.
	NullCount() int
	// Return if the element at index i is null.
	IsNull(i int) bool
	// Return the null mask of the series.
	GetNullMask() []bool
	// Set the null mask of the series.
	SetNullMask(mask []bool) Series
	// Make the series nullable.
	MakeNullable() Series
	// Make the series non-nullable.
	MakeNonNullable() Series

	// Get the element at index i.
	Get(i int) any
	// Get the element at index i as a string.
	GetAsString(i int) string
	// Set the element at index i.
	Set(i int, v any) Series
	// Take the elements according to the given interval.
	Take(params ...int) Series

	// Append elements to the series.
	// Value can be a single value, slice of values,
	// a nullable value, a slice of nullable values or a series.
	Append(v any) Series

	// Return the actual data of the series.
	Data() any
	// Return the nullable data of the series.
	DataAsNullable() any
	// Return the data of the series as a slice of strings.
	DataAsString() []string

	// Cast the series to a given type.
	Cast(t preludiometa.BaseType) Series
	// Copie the series.
	Copy() Series

	// Filter out the elements by the given mask.
	// Mask can be a bool series, a slice of bools or a slice of ints.
	Filter(mask any) Series

	// Apply the given function to each element of the series.
	Map(f MapFunc) Series
	MapNull(f MapFuncNull) Series

	GroupBy(gp SeriesPartition) Series
	UnGroup() Series

	// Get the partition of the series.
	GetPartition() SeriesPartition

	// Sort Interface.
	Less(i, j int) bool

	Swap(i, j int)

	// Sort the elements of the series.
	Sort() Series
	SortRev() Series

	// Boolean operations.
	And(other any) Series
	Or(other any) Series

	// Arithmetic operations.
	Mul(other any) Series
	Div(other any) Series
	Mod(other any) Series
	Exp(other any) Series
	Add(other any) Series
	Sub(other any) Series

	// Logical operations.
	Eq(other any) Series
	Ne(other any) Series
	Gt(other any) Series
	Ge(other any) Series
	Lt(other any) Series
	Le(other any) Series
	// contains filtered or unexported methods
}

func NewSeries

func NewSeries(data interface{}, nullMask []bool, makeCopy bool, memOpt bool, ctx *Context) Series

Build a Series from a generic interface. The interface can be a single value, slice of values, a nullable value, a slice of nullable values. If nullMask is nil then the series is not nullable.

type SeriesBool

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

SeriesBool represents a series of bools. The data is stored as a byte array, with each bit representing a bool.

func NewSeriesBool

func NewSeriesBool(data []bool, nullMask []bool, makeCopy bool, ctx *Context) SeriesBool

Build a Bool Series, if nullMask is nil then the series is not nullable

func (SeriesBool) Add

func (s SeriesBool) Add(other any) Series

func (SeriesBool) All

func (s SeriesBool) All() bool

func (SeriesBool) And

func (s SeriesBool) And(other any) Series

func (SeriesBool) Any

func (s SeriesBool) Any() bool

func (SeriesBool) Append

func (s SeriesBool) Append(v any) Series

Append appends a value or a slice of values to the series.

func (SeriesBool) Bools

func (s SeriesBool) Bools() []bool

Return the underlying data as a slice of bools.

func (SeriesBool) Cast

Cast the series to a given type.

func (SeriesBool) Copy

func (s SeriesBool) Copy() Series

Copy the series.

func (SeriesBool) Data

func (s SeriesBool) Data() any

Return the elements of the series as a slice.

func (SeriesBool) DataAsNullable

func (s SeriesBool) DataAsNullable() any

Return the underlying data as a slice of NullableBool.

func (SeriesBool) DataAsString

func (s SeriesBool) DataAsString() []string

Return the data as a slice of strings.

func (SeriesBool) Div

func (s SeriesBool) Div(other any) Series

func (SeriesBool) Eq

func (s SeriesBool) Eq(other any) Series

func (SeriesBool) Exp

func (s SeriesBool) Exp(other any) Series

func (SeriesBool) Filter

func (s SeriesBool) Filter(mask any) Series

Filters out the elements by the given mask. Mask can be SeriesBool, SeriesInt, bool slice or a int slice.

func (SeriesBool) Ge

func (s SeriesBool) Ge(other any) Series

func (SeriesBool) Get

func (s SeriesBool) Get(i int) any

Get the element at index i.

func (SeriesBool) GetAsString

func (s SeriesBool) GetAsString(i int) string

Get the element at index i as a string.

func (SeriesBool) GetContext

func (s SeriesBool) GetContext() *Context

Return the context of the series.

func (SeriesBool) GetError

func (s SeriesBool) GetError() string

Return the error message of the series.

func (SeriesBool) GetNullMask

func (s SeriesBool) GetNullMask() []bool

Return the null mask of the series.

func (SeriesBool) GetPartition

func (s SeriesBool) GetPartition() SeriesPartition

Return the partition of the series.

func (SeriesBool) GroupBy

func (s SeriesBool) GroupBy(partition SeriesPartition) Series

func (SeriesBool) Gt

func (s SeriesBool) Gt(other any) Series

func (SeriesBool) HasNull

func (s SeriesBool) HasNull() bool

Return if the series has null values.

func (SeriesBool) IsError

func (s SeriesBool) IsError() bool

Return if the series is error.

func (SeriesBool) IsGrouped

func (s SeriesBool) IsGrouped() bool

Return if the series is grouped.

func (SeriesBool) IsNull

func (s SeriesBool) IsNull(i int) bool

Return if the element at index i is null.

func (SeriesBool) IsNullable

func (s SeriesBool) IsNullable() bool

Return if the series admits null values.

func (SeriesBool) IsSorted

func (s SeriesBool) IsSorted() SeriesSortOrder

Return if the series is sorted.

func (SeriesBool) Le

func (s SeriesBool) Le(other any) Series

func (SeriesBool) Len

func (s SeriesBool) Len() int

Return the number of elements in the series.

func (SeriesBool) Less

func (s SeriesBool) Less(i, j int) bool

func (SeriesBool) Lt

func (s SeriesBool) Lt(other any) Series

func (SeriesBool) MakeNonNullable

func (s SeriesBool) MakeNonNullable() Series

Make the series non-nullable.

func (SeriesBool) MakeNullable

func (s SeriesBool) MakeNullable() Series

Make the series nullable.

func (SeriesBool) Map

func (s SeriesBool) Map(f MapFunc) Series

Apply the given function to each element of the series.

func (SeriesBool) MapNull

func (s SeriesBool) MapNull(f MapFuncNull) Series

Apply the given function to each element of the series.

func (SeriesBool) Mod

func (s SeriesBool) Mod(other any) Series

func (SeriesBool) Mul

func (s SeriesBool) Mul(other any) Series

func (SeriesBool) Ne

func (s SeriesBool) Ne(other any) Series

func (SeriesBool) Not

func (s SeriesBool) Not() Series

Not performs logical NOT operation on series

func (SeriesBool) NullCount

func (s SeriesBool) NullCount() int

Return the number of null values in the series.

func (SeriesBool) Or

func (s SeriesBool) Or(other any) Series

func (SeriesBool) Set

func (s SeriesBool) Set(i int, v any) Series

Set the element at index i. The value must be of type bool or NullableBool.

func (SeriesBool) SetNullMask

func (s SeriesBool) SetNullMask(mask []bool) Series

Set the null mask of the series.

func (SeriesBool) Sort

func (s SeriesBool) Sort() Series

func (SeriesBool) SortRev

func (s SeriesBool) SortRev() Series

func (SeriesBool) Sub

func (s SeriesBool) Sub(other any) Series

func (SeriesBool) Swap

func (s SeriesBool) Swap(i, j int)

func (SeriesBool) Take

func (s SeriesBool) Take(params ...int) Series

Take the elements according to the given interval.

func (SeriesBool) Type

func (s SeriesBool) Type() preludiometa.BaseType

Return the type of the series.

func (SeriesBool) TypeCard

func (s SeriesBool) TypeCard() preludiometa.BaseTypeCard

Return the type and cardinality of the series.

func (SeriesBool) UnGroup

func (s SeriesBool) UnGroup() Series

Ungroup the series.

type SeriesBoolPartition

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

A SeriesBoolPartition is a partition of a SeriesBool. Each key is a hash of a bool value, and each value is a slice of indices of the original series that are set to that value.

type SeriesDuration

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

SeriesDuration represents a duration series.

func NewSeriesDuration

func NewSeriesDuration(data []time.Duration, nullMask []bool, makeCopy bool, ctx *Context) SeriesDuration

Build a Duration Series, if nullMask is nil then the series is not nullable

func (SeriesDuration) Add

func (s SeriesDuration) Add(other any) Series

func (SeriesDuration) And

func (s SeriesDuration) And(other any) Series

func (SeriesDuration) Append

func (s SeriesDuration) Append(v any) Series

Append appends a value or a slice of values to the series.

func (SeriesDuration) Cast

Casts the series to a given type.

func (SeriesDuration) Copy

func (s SeriesDuration) Copy() Series

Copy the series.

func (SeriesDuration) Data

func (s SeriesDuration) Data() any

Return the elements of the series as a slice.

func (SeriesDuration) DataAsNullable

func (s SeriesDuration) DataAsNullable() any

Return the underlying data as a slice of NullableDuration.

func (SeriesDuration) DataAsString

func (s SeriesDuration) DataAsString() []string

Return the underlying data as a slice of strings.

func (SeriesDuration) Div

func (s SeriesDuration) Div(other any) Series

func (SeriesDuration) Eq

func (s SeriesDuration) Eq(other any) Series

func (SeriesDuration) Exp

func (s SeriesDuration) Exp(other any) Series

func (SeriesDuration) Filter

func (s SeriesDuration) Filter(mask any) Series

Filters out the elements by the given mask. Mask can be SeriesBool, SeriesInt, bool slice or a int slice.

func (SeriesDuration) Ge

func (s SeriesDuration) Ge(other any) Series

func (SeriesDuration) Get

func (s SeriesDuration) Get(i int) any

Get the element at index i.

func (SeriesDuration) GetAsString

func (s SeriesDuration) GetAsString(i int) string

Get the element at index i as a string.

func (SeriesDuration) GetContext

func (s SeriesDuration) GetContext() *Context

Return the context of the series.

func (SeriesDuration) GetError

func (s SeriesDuration) GetError() string

Return the error message of the series.

func (SeriesDuration) GetNullMask

func (s SeriesDuration) GetNullMask() []bool

Return the null mask of the series.

func (SeriesDuration) GetPartition

func (s SeriesDuration) GetPartition() SeriesPartition

Return the partition of the series.

func (SeriesDuration) GroupBy

func (s SeriesDuration) GroupBy(partition SeriesPartition) Series

func (SeriesDuration) Gt

func (s SeriesDuration) Gt(other any) Series

func (SeriesDuration) HasNull

func (s SeriesDuration) HasNull() bool

Return if the series has null values.

func (SeriesDuration) IsError

func (s SeriesDuration) IsError() bool

Return if the series is error.

func (SeriesDuration) IsGrouped

func (s SeriesDuration) IsGrouped() bool

Return if the series is grouped.

func (SeriesDuration) IsNull

func (s SeriesDuration) IsNull(i int) bool

Return if the element at index i is null.

func (SeriesDuration) IsNullable

func (s SeriesDuration) IsNullable() bool

Return if the series admits null values.

func (SeriesDuration) IsSorted

func (s SeriesDuration) IsSorted() SeriesSortOrder

Return if the series is sorted.

func (SeriesDuration) Le

func (s SeriesDuration) Le(other any) Series

func (SeriesDuration) Len

func (s SeriesDuration) Len() int

Return the number of elements in the series.

func (SeriesDuration) Less

func (s SeriesDuration) Less(i, j int) bool

func (SeriesDuration) Lt

func (s SeriesDuration) Lt(other any) Series

func (SeriesDuration) MakeNonNullable

func (s SeriesDuration) MakeNonNullable() Series

Make the series non-nullable.

func (SeriesDuration) MakeNullable

func (s SeriesDuration) MakeNullable() Series

Make the series nullable.

func (SeriesDuration) Map

func (s SeriesDuration) Map(f MapFunc) Series

Apply the given function to each element of the series.

func (SeriesDuration) MapNull

func (s SeriesDuration) MapNull(f MapFuncNull) Series

Apply the given function to each element of the series.

func (SeriesDuration) Mod

func (s SeriesDuration) Mod(other any) Series

func (SeriesDuration) Mul

func (s SeriesDuration) Mul(other any) Series

func (SeriesDuration) Ne

func (s SeriesDuration) Ne(other any) Series

func (SeriesDuration) NullCount

func (s SeriesDuration) NullCount() int

Return the number of null values in the series.

func (SeriesDuration) Or

func (s SeriesDuration) Or(other any) Series

func (SeriesDuration) Set

func (s SeriesDuration) Set(i int, v any) Series

Set the element at index i. The value v must be of type time.Duration or NullableDuration.

func (SeriesDuration) SetNullMask

func (s SeriesDuration) SetNullMask(mask []bool) Series

Set the null mask of the series.

func (SeriesDuration) Sort

func (s SeriesDuration) Sort() Series

func (SeriesDuration) SortRev

func (s SeriesDuration) SortRev() Series

func (SeriesDuration) Sub

func (s SeriesDuration) Sub(other any) Series

func (SeriesDuration) Swap

func (s SeriesDuration) Swap(i, j int)

func (SeriesDuration) Take

func (s SeriesDuration) Take(params ...int) Series

Take the elements according to the given interval.

func (SeriesDuration) Times

func (s SeriesDuration) Times() []time.Duration

Return the underlying data as a slice of time.Duration.

func (SeriesDuration) Type

Return the type of the series.

func (SeriesDuration) TypeCard

Return the type and cardinality of the series.

func (SeriesDuration) UnGroup

func (s SeriesDuration) UnGroup() Series

Ungroup the series.

type SeriesDurationPartition

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

A SeriesDurationPartition is a partition of a SeriesDuration. Each key is a hash of a bool value, and each value is a slice of indices of the original series that are set to that value.

type SeriesError

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

Dummy series for error handling.

func NewSeriesError

func NewSeriesError(err string) SeriesError

Build an Error Series

func (SeriesError) Add

func (s SeriesError) Add(other any) Series

func (SeriesError) And

func (s SeriesError) And(other any) Series

func (SeriesError) Append

func (s SeriesError) Append(v any) Series

Append elements to the series.

func (SeriesError) Cast

Casts the series to a given type.

func (SeriesError) Copy

func (s SeriesError) Copy() Series

Copies the series.

func (SeriesError) Data

func (s SeriesError) Data() any

Returns the actual data of the series.

func (SeriesError) DataAsNullable

func (s SeriesError) DataAsNullable() any

Returns the nullable data of the series.

func (SeriesError) DataAsString

func (s SeriesError) DataAsString() []string

Returns the data of the series as a slice of strings.

func (SeriesError) Div

func (s SeriesError) Div(other any) Series

func (SeriesError) Eq

func (s SeriesError) Eq(other any) Series

func (SeriesError) Exp

func (s SeriesError) Exp(other any) Series

func (SeriesError) Filter

func (s SeriesError) Filter(mask any) Series

Filters out the elements by the given mask. Mask can be a bool series, a slice of bools or a slice of ints.

func (SeriesError) Ge

func (s SeriesError) Ge(other any) Series

func (SeriesError) Get

func (s SeriesError) Get(i int) any

Get the element at index i.

func (SeriesError) GetAsString

func (s SeriesError) GetAsString(i int) string

func (SeriesError) GetContext

func (s SeriesError) GetContext() *Context

Return the context of the series.

func (SeriesError) GetError

func (s SeriesError) GetError() string

Returns the error message of the series.

func (SeriesError) GetNullMask

func (s SeriesError) GetNullMask() []bool

Returns the null mask of the series.

func (SeriesError) GetPartition

func (s SeriesError) GetPartition() SeriesPartition

func (SeriesError) GroupBy

func (s SeriesError) GroupBy(gp SeriesPartition) Series

func (SeriesError) Gt

func (s SeriesError) Gt(other any) Series

func (SeriesError) HasNull

func (s SeriesError) HasNull() bool

Returns if the series has null values.

func (SeriesError) IsError

func (s SeriesError) IsError() bool

Returns if the series is error.

func (SeriesError) IsGrouped

func (s SeriesError) IsGrouped() bool

Returns if the series is grouped.

func (SeriesError) IsNull

func (s SeriesError) IsNull(i int) bool

Returns if the element at index i is null.

func (SeriesError) IsNullable

func (s SeriesError) IsNullable() bool

Returns if the series admits null values.

func (SeriesError) IsSorted

func (s SeriesError) IsSorted() SeriesSortOrder

func (SeriesError) Le

func (s SeriesError) Le(other any) Series

func (SeriesError) Len

func (s SeriesError) Len() int

Returns the length of the series.

func (SeriesError) Less

func (s SeriesError) Less(i, j int) bool

Sort interface.

func (SeriesError) Lt

func (s SeriesError) Lt(other any) Series

func (SeriesError) MakeNonNullable

func (s SeriesError) MakeNonNullable() Series

Make the series non-nullable.

func (SeriesError) MakeNullable

func (s SeriesError) MakeNullable() Series

Makes the series nullable.

func (SeriesError) Map

func (s SeriesError) Map(f MapFunc) Series

func (SeriesError) MapNull

func (s SeriesError) MapNull(f MapFuncNull) Series

func (SeriesError) Mod

func (s SeriesError) Mod(other any) Series

func (SeriesError) Mul

func (s SeriesError) Mul(other any) Series

func (SeriesError) Ne

func (s SeriesError) Ne(other any) Series

func (SeriesError) NullCount

func (s SeriesError) NullCount() int

Returns the number of null values in the series.

func (SeriesError) Or

func (s SeriesError) Or(other any) Series

func (SeriesError) Set

func (s SeriesError) Set(i int, v any) Series

Set the element at index i.

func (SeriesError) SetNullMask

func (s SeriesError) SetNullMask(mask []bool) Series

Sets the null mask of the series.

func (SeriesError) Sort

func (s SeriesError) Sort() Series

func (SeriesError) SortRev

func (s SeriesError) SortRev() Series

func (SeriesError) Sub

func (s SeriesError) Sub(other any) Series

func (SeriesError) Swap

func (s SeriesError) Swap(i, j int)

func (SeriesError) Take

func (s SeriesError) Take(params ...int) Series

Take the elements according to the given interval.

func (SeriesError) Type

Returns the type of the series.

func (SeriesError) TypeCard

func (s SeriesError) TypeCard() preludiometa.BaseTypeCard

Returns the type and cardinality of the series.

func (SeriesError) UnGroup

func (s SeriesError) UnGroup() Series

type SeriesFloat64

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

SeriesFloat64 represents a series of floats.

func NewSeriesFloat64

func NewSeriesFloat64(data []float64, nullMask []bool, makeCopy bool, ctx *Context) SeriesFloat64

Build a Float64 Series, if nullMask is nil then the series is not nullable

func (SeriesFloat64) Add

func (s SeriesFloat64) Add(other any) Series

func (SeriesFloat64) And

func (s SeriesFloat64) And(other any) Series

func (SeriesFloat64) Append

func (s SeriesFloat64) Append(v any) Series

Append appends a value or a slice of values to the series.

func (SeriesFloat64) Cast

Casts the series to a given type.

func (SeriesFloat64) Copy

func (s SeriesFloat64) Copy() Series

Copy the series.

func (SeriesFloat64) Data

func (s SeriesFloat64) Data() any

Return the elements of the series as a slice.

func (SeriesFloat64) DataAsNullable

func (s SeriesFloat64) DataAsNullable() any

Return the underlying data as a slice of NullableFloat64.

func (SeriesFloat64) DataAsString

func (s SeriesFloat64) DataAsString() []string

Return the underlying data as a slice of strings.

func (SeriesFloat64) Div

func (s SeriesFloat64) Div(other any) Series

func (SeriesFloat64) Eq

func (s SeriesFloat64) Eq(other any) Series

func (SeriesFloat64) Exp

func (s SeriesFloat64) Exp(other any) Series

func (SeriesFloat64) Filter

func (s SeriesFloat64) Filter(mask any) Series

Filters out the elements by the given mask. Mask can be SeriesBool, SeriesInt, bool slice or a int slice.

func (SeriesFloat64) Float64s

func (s SeriesFloat64) Float64s() []float64

Return the underlying data as a slice of float64.

func (SeriesFloat64) Ge

func (s SeriesFloat64) Ge(other any) Series

func (SeriesFloat64) Get

func (s SeriesFloat64) Get(i int) any

Get the element at index i.

func (SeriesFloat64) GetAsString

func (s SeriesFloat64) GetAsString(i int) string

Get the element at index i as a string.

func (SeriesFloat64) GetContext

func (s SeriesFloat64) GetContext() *Context

Return the context of the series.

func (SeriesFloat64) GetError

func (s SeriesFloat64) GetError() string

Return the error message of the series.

func (SeriesFloat64) GetNullMask

func (s SeriesFloat64) GetNullMask() []bool

Return the null mask of the series.

func (SeriesFloat64) GetPartition

func (s SeriesFloat64) GetPartition() SeriesPartition

Return the partition of the series.

func (SeriesFloat64) GroupBy

func (s SeriesFloat64) GroupBy(partition SeriesPartition) Series

func (SeriesFloat64) Gt

func (s SeriesFloat64) Gt(other any) Series

func (SeriesFloat64) HasNull

func (s SeriesFloat64) HasNull() bool

Return if the series has null values.

func (SeriesFloat64) IsError

func (s SeriesFloat64) IsError() bool

Return if the series is error.

func (SeriesFloat64) IsGrouped

func (s SeriesFloat64) IsGrouped() bool

Return if the series is grouped.

func (SeriesFloat64) IsNull

func (s SeriesFloat64) IsNull(i int) bool

Return if the element at index i is null.

func (SeriesFloat64) IsNullable

func (s SeriesFloat64) IsNullable() bool

Return if the series admits null values.

func (SeriesFloat64) IsSorted

func (s SeriesFloat64) IsSorted() SeriesSortOrder

Return if the series is sorted.

func (SeriesFloat64) Le

func (s SeriesFloat64) Le(other any) Series

func (SeriesFloat64) Len

func (s SeriesFloat64) Len() int

Return the number of elements in the series.

func (SeriesFloat64) Less

func (s SeriesFloat64) Less(i, j int) bool

func (SeriesFloat64) Lt

func (s SeriesFloat64) Lt(other any) Series

func (SeriesFloat64) MakeNonNullable

func (s SeriesFloat64) MakeNonNullable() Series

Make the series non-nullable.

func (SeriesFloat64) MakeNullable

func (s SeriesFloat64) MakeNullable() Series

Make the series nullable.

func (SeriesFloat64) Map

func (s SeriesFloat64) Map(f MapFunc) Series

Apply the given function to each element of the series.

func (SeriesFloat64) MapNull

func (s SeriesFloat64) MapNull(f MapFuncNull) Series

Apply the given function to each element of the series.

func (SeriesFloat64) Min

func (s SeriesFloat64) Min() any

func (SeriesFloat64) Mod

func (s SeriesFloat64) Mod(other any) Series

func (SeriesFloat64) Mul

func (s SeriesFloat64) Mul(other any) Series

func (SeriesFloat64) Ne

func (s SeriesFloat64) Ne(other any) Series

func (SeriesFloat64) Neg

func (s SeriesFloat64) Neg() Series

func (SeriesFloat64) NullCount

func (s SeriesFloat64) NullCount() int

Return the number of null values in the series.

func (SeriesFloat64) Or

func (s SeriesFloat64) Or(other any) Series

func (SeriesFloat64) Set

func (s SeriesFloat64) Set(i int, v any) Series

Set the element at index i. The value v can be any belonging to types: int8, int16, int, int, int64, float32, float64 and their nullable versions.

func (SeriesFloat64) SetNullMask

func (s SeriesFloat64) SetNullMask(mask []bool) Series

Set the null mask of the series.

func (SeriesFloat64) Sort

func (s SeriesFloat64) Sort() Series

func (SeriesFloat64) SortRev

func (s SeriesFloat64) SortRev() Series

func (SeriesFloat64) Sub

func (s SeriesFloat64) Sub(other any) Series

func (SeriesFloat64) Swap

func (s SeriesFloat64) Swap(i, j int)

func (SeriesFloat64) Take

func (s SeriesFloat64) Take(params ...int) Series

Take the elements according to the given interval.

func (SeriesFloat64) Type

Return the type of the series.

func (SeriesFloat64) TypeCard

Return the type and cardinality of the series.

func (SeriesFloat64) UnGroup

func (s SeriesFloat64) UnGroup() Series

Ungroup the series.

type SeriesFloat64Partition

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

A SeriesFloat64Partition is a partition of a SeriesFloat64. Each key is a hash of a bool value, and each value is a slice of indices of the original series that are set to that value.

type SeriesInt

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

SeriesInt represents a series of ints.

func NewSeriesInt

func NewSeriesInt(data []int, nullMask []bool, makeCopy bool, ctx *Context) SeriesInt

Build a Int Series, if nullMask is nil then the series is not nullable

func (SeriesInt) Add

func (s SeriesInt) Add(other any) Series

func (SeriesInt) And

func (s SeriesInt) And(other any) Series

func (SeriesInt) Append

func (s SeriesInt) Append(v any) Series

Append appends a value or a slice of values to the series.

func (SeriesInt) Cast

Casts the series to a given type.

func (SeriesInt) Copy

func (s SeriesInt) Copy() Series

Copy the series.

func (SeriesInt) Data

func (s SeriesInt) Data() any

Return the elements of the series as a slice.

func (SeriesInt) DataAsNullable

func (s SeriesInt) DataAsNullable() any

Return the underlying data as a slice of NullableInt.

func (SeriesInt) DataAsString

func (s SeriesInt) DataAsString() []string

Return the underlying data as a slice of strings.

func (SeriesInt) Div

func (s SeriesInt) Div(other any) Series

func (SeriesInt) Eq

func (s SeriesInt) Eq(other any) Series

func (SeriesInt) Exp

func (s SeriesInt) Exp(other any) Series

func (SeriesInt) Filter

func (s SeriesInt) Filter(mask any) Series

Filters out the elements by the given mask. Mask can be SeriesBool, SeriesInt, bool slice or a int slice.

func (SeriesInt) Ge

func (s SeriesInt) Ge(other any) Series

func (SeriesInt) Get

func (s SeriesInt) Get(i int) any

Get the element at index i.

func (SeriesInt) GetAsString

func (s SeriesInt) GetAsString(i int) string

Get the element at index i as a string.

func (SeriesInt) GetContext

func (s SeriesInt) GetContext() *Context

Return the context of the series.

func (SeriesInt) GetError

func (s SeriesInt) GetError() string

Return the error message of the series.

func (SeriesInt) GetNullMask

func (s SeriesInt) GetNullMask() []bool

Return the null mask of the series.

func (SeriesInt) GetPartition

func (s SeriesInt) GetPartition() SeriesPartition

Return the partition of the series.

func (SeriesInt) GroupBy

func (s SeriesInt) GroupBy(partition SeriesPartition) Series

func (SeriesInt) Gt

func (s SeriesInt) Gt(other any) Series

func (SeriesInt) HasNull

func (s SeriesInt) HasNull() bool

Return if the series has null values.

func (SeriesInt) Ints

func (s SeriesInt) Ints() []int

Return the underlying data as a slice of int.

func (SeriesInt) IsError

func (s SeriesInt) IsError() bool

Return if the series is error.

func (SeriesInt) IsGrouped

func (s SeriesInt) IsGrouped() bool

Return if the series is grouped.

func (SeriesInt) IsNull

func (s SeriesInt) IsNull(i int) bool

Return if the element at index i is null.

func (SeriesInt) IsNullable

func (s SeriesInt) IsNullable() bool

Return if the series admits null values.

func (SeriesInt) IsSorted

func (s SeriesInt) IsSorted() SeriesSortOrder

Return if the series is sorted.

func (SeriesInt) Le

func (s SeriesInt) Le(other any) Series

func (SeriesInt) Len

func (s SeriesInt) Len() int

Return the number of elements in the series.

func (SeriesInt) Less

func (s SeriesInt) Less(i, j int) bool

func (SeriesInt) Lt

func (s SeriesInt) Lt(other any) Series

func (SeriesInt) MakeNonNullable

func (s SeriesInt) MakeNonNullable() Series

Make the series non-nullable.

func (SeriesInt) MakeNullable

func (s SeriesInt) MakeNullable() Series

Make the series nullable.

func (SeriesInt) Map

func (s SeriesInt) Map(f MapFunc) Series

Apply the given function to each element of the series.

func (SeriesInt) MapNull

func (s SeriesInt) MapNull(f MapFuncNull) Series

Apply the given function to each element of the series.

func (SeriesInt) Mod

func (s SeriesInt) Mod(other any) Series

func (SeriesInt) Mul

func (s SeriesInt) Mul(other any) Series

func (SeriesInt) Ne

func (s SeriesInt) Ne(other any) Series

func (SeriesInt) Neg

func (s SeriesInt) Neg() Series

func (SeriesInt) NullCount

func (s SeriesInt) NullCount() int

Return the number of null values in the series.

func (SeriesInt) Or

func (s SeriesInt) Or(other any) Series

func (SeriesInt) Set

func (s SeriesInt) Set(i int, v any) Series

Set the element at index i. The value v can be any belonging to types: int8, int16, int, int, int64 and their nullable versions.

func (SeriesInt) SetNullMask

func (s SeriesInt) SetNullMask(mask []bool) Series

Set the null mask of the series.

func (SeriesInt) Sort

func (s SeriesInt) Sort() Series

func (SeriesInt) SortRev

func (s SeriesInt) SortRev() Series

func (SeriesInt) Sub

func (s SeriesInt) Sub(other any) Series

func (SeriesInt) Swap

func (s SeriesInt) Swap(i, j int)

func (SeriesInt) Take

func (s SeriesInt) Take(params ...int) Series

Take the elements according to the given interval.

func (SeriesInt) Type

func (s SeriesInt) Type() preludiometa.BaseType

Return the type of the series.

func (SeriesInt) TypeCard

func (s SeriesInt) TypeCard() preludiometa.BaseTypeCard

Return the type and cardinality of the series.

func (SeriesInt) UnGroup

func (s SeriesInt) UnGroup() Series

Ungroup the series.

type SeriesInt64

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

SeriesInt64 represents a series of ints.

func NewSeriesInt64

func NewSeriesInt64(data []int64, nullMask []bool, makeCopy bool, ctx *Context) SeriesInt64

Build a Int64 Series, if nullMask is nil then the series is not nullable

func (SeriesInt64) Add

func (s SeriesInt64) Add(other any) Series

func (SeriesInt64) And

func (s SeriesInt64) And(other any) Series

func (SeriesInt64) Append

func (s SeriesInt64) Append(v any) Series

Append appends a value or a slice of values to the series.

func (SeriesInt64) Cast

Casts the series to a given type.

func (SeriesInt64) Copy

func (s SeriesInt64) Copy() Series

Copy the series.

func (SeriesInt64) Data

func (s SeriesInt64) Data() any

Return the elements of the series as a slice.

func (SeriesInt64) DataAsNullable

func (s SeriesInt64) DataAsNullable() any

Return the underlying data as a slice of NullableInt64.

func (SeriesInt64) DataAsString

func (s SeriesInt64) DataAsString() []string

Return the underlying data as a slice of strings.

func (SeriesInt64) Div

func (s SeriesInt64) Div(other any) Series

func (SeriesInt64) Eq

func (s SeriesInt64) Eq(other any) Series

func (SeriesInt64) Exp

func (s SeriesInt64) Exp(other any) Series

func (SeriesInt64) Filter

func (s SeriesInt64) Filter(mask any) Series

Filters out the elements by the given mask. Mask can be SeriesBool, SeriesInt, bool slice or a int slice.

func (SeriesInt64) Ge

func (s SeriesInt64) Ge(other any) Series

func (SeriesInt64) Get

func (s SeriesInt64) Get(i int) any

Get the element at index i.

func (SeriesInt64) GetAsString

func (s SeriesInt64) GetAsString(i int) string

Get the element at index i as a string.

func (SeriesInt64) GetContext

func (s SeriesInt64) GetContext() *Context

Return the context of the series.

func (SeriesInt64) GetError

func (s SeriesInt64) GetError() string

Return the error message of the series.

func (SeriesInt64) GetNullMask

func (s SeriesInt64) GetNullMask() []bool

Return the null mask of the series.

func (SeriesInt64) GetPartition

func (s SeriesInt64) GetPartition() SeriesPartition

Return the partition of the series.

func (SeriesInt64) GroupBy

func (s SeriesInt64) GroupBy(partition SeriesPartition) Series

func (SeriesInt64) Gt

func (s SeriesInt64) Gt(other any) Series

func (SeriesInt64) HasNull

func (s SeriesInt64) HasNull() bool

Return if the series has null values.

func (SeriesInt64) Int64s

func (s SeriesInt64) Int64s() []int64

Return the underlying data as a slice of int64.

func (SeriesInt64) IsError

func (s SeriesInt64) IsError() bool

Return if the series is error.

func (SeriesInt64) IsGrouped

func (s SeriesInt64) IsGrouped() bool

Return if the series is grouped.

func (SeriesInt64) IsNull

func (s SeriesInt64) IsNull(i int) bool

Return if the element at index i is null.

func (SeriesInt64) IsNullable

func (s SeriesInt64) IsNullable() bool

Return if the series admits null values.

func (SeriesInt64) IsSorted

func (s SeriesInt64) IsSorted() SeriesSortOrder

Return if the series is sorted.

func (SeriesInt64) Le

func (s SeriesInt64) Le(other any) Series

func (SeriesInt64) Len

func (s SeriesInt64) Len() int

Return the number of elements in the series.

func (SeriesInt64) Less

func (s SeriesInt64) Less(i, j int) bool

func (SeriesInt64) Lt

func (s SeriesInt64) Lt(other any) Series

func (SeriesInt64) MakeNonNullable

func (s SeriesInt64) MakeNonNullable() Series

Make the series non-nullable.

func (SeriesInt64) MakeNullable

func (s SeriesInt64) MakeNullable() Series

Make the series nullable.

func (SeriesInt64) Map

func (s SeriesInt64) Map(f MapFunc) Series

Apply the given function to each element of the series.

func (SeriesInt64) MapNull

func (s SeriesInt64) MapNull(f MapFuncNull) Series

Apply the given function to each element of the series.

func (SeriesInt64) Mod

func (s SeriesInt64) Mod(other any) Series

func (SeriesInt64) Mul

func (s SeriesInt64) Mul(other any) Series

func (SeriesInt64) Ne

func (s SeriesInt64) Ne(other any) Series

func (SeriesInt64) Neg

func (s SeriesInt64) Neg() Series

func (SeriesInt64) NullCount

func (s SeriesInt64) NullCount() int

Return the number of null values in the series.

func (SeriesInt64) Or

func (s SeriesInt64) Or(other any) Series

func (SeriesInt64) Set

func (s SeriesInt64) Set(i int, v any) Series

Set the element at index i. The value v can be any belonging to types: int8, int16, int, int, int64 and their nullable versions.

func (SeriesInt64) SetNullMask

func (s SeriesInt64) SetNullMask(mask []bool) Series

Set the null mask of the series.

func (SeriesInt64) Sort

func (s SeriesInt64) Sort() Series

func (SeriesInt64) SortRev

func (s SeriesInt64) SortRev() Series

func (SeriesInt64) Sub

func (s SeriesInt64) Sub(other any) Series

func (SeriesInt64) Swap

func (s SeriesInt64) Swap(i, j int)

func (SeriesInt64) Take

func (s SeriesInt64) Take(params ...int) Series

Take the elements according to the given interval.

func (SeriesInt64) Type

Return the type of the series.

func (SeriesInt64) TypeCard

func (s SeriesInt64) TypeCard() preludiometa.BaseTypeCard

Return the type and cardinality of the series.

func (SeriesInt64) UnGroup

func (s SeriesInt64) UnGroup() Series

Ungroup the series.

type SeriesInt64Partition

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

A SeriesInt64Partition is a partition of a SeriesInt64. Each key is a hash of a bool value, and each value is a slice of indices of the original series that are set to that value.

type SeriesIntPartition

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

A SeriesIntPartition is a partition of a SeriesInt. Each key is a hash of a bool value, and each value is a slice of indices of the original series that are set to that value.

type SeriesNA

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

SeriesNA represents a series with no data.

func NewSeriesNA

func NewSeriesNA(size int, ctx *Context) SeriesNA

Build an NA Series

func (SeriesNA) Add

func (s SeriesNA) Add(other any) Series

func (SeriesNA) And

func (s SeriesNA) And(other any) Series

func (SeriesNA) Append

func (s SeriesNA) Append(v any) Series

Append elements to the series.

func (SeriesNA) Cast

Casts the series to a given type.

func (SeriesNA) Copy

func (s SeriesNA) Copy() Series

Copies the series.

func (SeriesNA) Data

func (s SeriesNA) Data() any

Returns the actual data of the series.

func (SeriesNA) DataAsNullable

func (s SeriesNA) DataAsNullable() any

Returns the nullable data of the series.

func (SeriesNA) DataAsString

func (s SeriesNA) DataAsString() []string

Returns the data of the series as a slice of strings.

func (SeriesNA) Div

func (s SeriesNA) Div(other any) Series

func (SeriesNA) Eq

func (s SeriesNA) Eq(other any) Series

func (SeriesNA) Exp

func (s SeriesNA) Exp(other any) Series

func (SeriesNA) Filter

func (s SeriesNA) Filter(mask any) Series

Filters out the elements by the given mask. Mask can be a bool series, a slice of bools or a slice of ints.

func (SeriesNA) Ge

func (s SeriesNA) Ge(other any) Series

func (SeriesNA) Get

func (s SeriesNA) Get(i int) any

Get the element at index i.

func (SeriesNA) GetAsString

func (s SeriesNA) GetAsString(i int) string

func (SeriesNA) GetContext

func (s SeriesNA) GetContext() *Context

Return the context of the series.

func (SeriesNA) GetError

func (s SeriesNA) GetError() string

Returns the error message of the series.

func (SeriesNA) GetNullMask

func (s SeriesNA) GetNullMask() []bool

Returns the null mask of the series.

func (SeriesNA) GetPartition

func (s SeriesNA) GetPartition() SeriesPartition

func (SeriesNA) GroupBy

func (s SeriesNA) GroupBy(gp SeriesPartition) Series

func (SeriesNA) Gt

func (s SeriesNA) Gt(other any) Series

func (SeriesNA) HasNull

func (s SeriesNA) HasNull() bool

Returns if the series has null values.

func (SeriesNA) IsError

func (s SeriesNA) IsError() bool

Returns if the series is error.

func (SeriesNA) IsGrouped

func (s SeriesNA) IsGrouped() bool

Returns if the series is grouped.

func (SeriesNA) IsNull

func (s SeriesNA) IsNull(i int) bool

Returns if the element at index i is null.

func (SeriesNA) IsNullable

func (s SeriesNA) IsNullable() bool

Returns if the series admits null values.

func (SeriesNA) IsSorted

func (s SeriesNA) IsSorted() SeriesSortOrder

func (SeriesNA) Le

func (s SeriesNA) Le(other any) Series

func (SeriesNA) Len

func (s SeriesNA) Len() int

Returns the length of the series.

func (SeriesNA) Less

func (s SeriesNA) Less(i, j int) bool

Sort interface.

func (SeriesNA) Lt

func (s SeriesNA) Lt(other any) Series

func (SeriesNA) MakeNonNullable

func (s SeriesNA) MakeNonNullable() Series

Make the series non-nullable.

func (SeriesNA) MakeNullable

func (s SeriesNA) MakeNullable() Series

Makes the series nullable.

func (SeriesNA) Map

func (s SeriesNA) Map(f MapFunc) Series

func (SeriesNA) MapNull

func (s SeriesNA) MapNull(f MapFuncNull) Series

func (SeriesNA) Mod

func (s SeriesNA) Mod(other any) Series

func (SeriesNA) Mul

func (s SeriesNA) Mul(other any) Series

func (SeriesNA) Ne

func (s SeriesNA) Ne(other any) Series

func (SeriesNA) Not

func (s SeriesNA) Not() Series

func (SeriesNA) NullCount

func (s SeriesNA) NullCount() int

Returns the number of null values in the series.

func (SeriesNA) Or

func (s SeriesNA) Or(other any) Series

func (SeriesNA) Set

func (s SeriesNA) Set(i int, v any) Series

Set the element at index i.

func (SeriesNA) SetNullMask

func (s SeriesNA) SetNullMask(mask []bool) Series

Sets the null mask of the series.

func (SeriesNA) Sort

func (s SeriesNA) Sort() Series

func (SeriesNA) SortRev

func (s SeriesNA) SortRev() Series

func (SeriesNA) Sub

func (s SeriesNA) Sub(other any) Series

func (SeriesNA) Swap

func (s SeriesNA) Swap(i, j int)

func (SeriesNA) Take

func (s SeriesNA) Take(params ...int) Series

Take the elements according to the given interval.

func (SeriesNA) Type

func (s SeriesNA) Type() preludiometa.BaseType

Returns the type of the series.

func (SeriesNA) TypeCard

func (s SeriesNA) TypeCard() preludiometa.BaseTypeCard

Returns the type and cardinality of the series.

func (SeriesNA) UnGroup

func (s SeriesNA) UnGroup() Series

type SeriesNAPartition

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

type SeriesNumeric

type SeriesNumeric interface {
	Series

	// Return the minimum value of the series.
	Min() any
	// Return the maximum value of the series.
	Max() any
	// Return the sum of the values of the series.
	Sum() any
	// Return the mean of the values of the series.
	Mean() any
	// Return the median of the values of the series.
	Median() any
	// Return the variance of the values of the series.
	Variance() any
	// Return the standard deviation of the values of the series.
	StdDev() any
	// Return the quantile of the values of the series.
	Quantile(q any) any
}

type SeriesPartition

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

type SeriesSortOrder

type SeriesSortOrder int16
const (
	// The series is not sorted.
	SORTED_NONE SeriesSortOrder = iota
	// The series is sorted in ascending order.
	SORTED_ASC
	// The series is sorted in descending order.
	SORTED_DESC
)

type SeriesString

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

SeriesString represents a series of strings.

func NewSeriesString

func NewSeriesString(data []string, nullMask []bool, makeCopy bool, ctx *Context) SeriesString

Build a String Series, if nullMask is nil then the series is not nullable

func (SeriesString) Add

func (s SeriesString) Add(other any) Series

func (SeriesString) And

func (s SeriesString) And(other any) Series

func (SeriesString) Append

func (s SeriesString) Append(v any) Series

Append appends a value or a slice of values to the series.

func (SeriesString) Cast

Casts the series to a given type.

func (SeriesString) Copy

func (s SeriesString) Copy() Series

Copy the series.

func (SeriesString) Data

func (s SeriesString) Data() any

Return the elements of the series as a slice.

func (SeriesString) DataAsNullable

func (s SeriesString) DataAsNullable() any

Return the underlying data as a slice of NullableString.

func (SeriesString) DataAsString

func (s SeriesString) DataAsString() []string

Return the underlying data as a slice of string.

func (SeriesString) Div

func (s SeriesString) Div(other any) Series

func (SeriesString) Eq

func (s SeriesString) Eq(other any) Series

func (SeriesString) Exp

func (s SeriesString) Exp(other any) Series

func (SeriesString) Filter

func (s SeriesString) Filter(mask any) Series

Filters out the elements by the given mask. Mask can be SeriesBool, SeriesInt, bool slice or a int slice.

func (SeriesString) Ge

func (s SeriesString) Ge(other any) Series

func (SeriesString) Get

func (s SeriesString) Get(i int) any

Get the element at index i.

func (SeriesString) GetAsString

func (s SeriesString) GetAsString(i int) string

Get the element at index i as a string.

func (SeriesString) GetContext

func (s SeriesString) GetContext() *Context

Return the context of the series.

func (SeriesString) GetError

func (s SeriesString) GetError() string

Return the error message of the series.

func (SeriesString) GetNullMask

func (s SeriesString) GetNullMask() []bool

Return the null mask of the series.

func (SeriesString) GetPartition

func (s SeriesString) GetPartition() SeriesPartition

Return the partition of the series.

func (SeriesString) GroupBy

func (s SeriesString) GroupBy(partition SeriesPartition) Series

func (SeriesString) Gt

func (s SeriesString) Gt(other any) Series

func (SeriesString) HasNull

func (s SeriesString) HasNull() bool

Return if the series has null values.

func (SeriesString) IsError

func (s SeriesString) IsError() bool

Return if the series is error.

func (SeriesString) IsGrouped

func (s SeriesString) IsGrouped() bool

Return if the series is grouped.

func (SeriesString) IsNull

func (s SeriesString) IsNull(i int) bool

Return if the element at index i is null.

func (SeriesString) IsNullable

func (s SeriesString) IsNullable() bool

Return if the series admits null values.

func (SeriesString) IsSorted

func (s SeriesString) IsSorted() SeriesSortOrder

Return if the series is sorted.

func (SeriesString) Le

func (s SeriesString) Le(other any) Series

func (SeriesString) Len

func (s SeriesString) Len() int

Return the number of elements in the series.

func (SeriesString) Less

func (s SeriesString) Less(i, j int) bool

func (SeriesString) Lt

func (s SeriesString) Lt(other any) Series

func (SeriesString) MakeNonNullable

func (s SeriesString) MakeNonNullable() Series

Make the series non-nullable.

func (SeriesString) MakeNullable

func (s SeriesString) MakeNullable() Series

Make the series nullable.

func (SeriesString) Map

func (s SeriesString) Map(f MapFunc) Series

Apply the given function to each element of the series.

func (SeriesString) MapNull

func (s SeriesString) MapNull(f MapFuncNull) Series

Apply the given function to each element of the series.

func (SeriesString) Mod

func (s SeriesString) Mod(other any) Series

func (SeriesString) Mul

func (s SeriesString) Mul(other any) Series

func (SeriesString) Ne

func (s SeriesString) Ne(other any) Series

func (SeriesString) NullCount

func (s SeriesString) NullCount() int

Return the number of null values in the series.

func (SeriesString) Or

func (s SeriesString) Or(other any) Series

func (SeriesString) ParseTime

func (s SeriesString) ParseTime(layout string) Series

Parse the series as a time series.

func (SeriesString) Replace

func (s SeriesString) Replace(old, new string, n int) Series

func (SeriesString) Set

func (s SeriesString) Set(i int, v any) Series

Set the element at index i. The value v must be of type string or NullableString.

func (SeriesString) SetNullMask

func (s SeriesString) SetNullMask(mask []bool) Series

Set the null mask of the series.

func (SeriesString) Sort

func (s SeriesString) Sort() Series

func (SeriesString) SortRev

func (s SeriesString) SortRev() Series

func (SeriesString) Strings

func (s SeriesString) Strings() []string

Return the underlying data as a slice of string.

func (SeriesString) Sub

func (s SeriesString) Sub(other any) Series

func (SeriesString) Swap

func (s SeriesString) Swap(i, j int)

func (SeriesString) Take

func (s SeriesString) Take(params ...int) Series

Take the elements according to the given interval.

func (SeriesString) ToLower

func (s SeriesString) ToLower() Series

func (SeriesString) ToUpper

func (s SeriesString) ToUpper() Series

func (SeriesString) Trim

func (s SeriesString) Trim(cutset string) Series

func (SeriesString) TrimSpace

func (s SeriesString) TrimSpace() Series

func (SeriesString) Type

Return the type of the series.

func (SeriesString) TypeCard

func (s SeriesString) TypeCard() preludiometa.BaseTypeCard

Return the type and cardinality of the series.

func (SeriesString) UnGroup

func (s SeriesString) UnGroup() Series

Ungroup the series.

type SeriesStringPartition

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

A SeriesStringPartition is a partition of a SeriesString. Each key is a hash of a bool value, and each value is a slice of indices of the original series that are set to that value.

type SeriesTime

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

SeriesTime represents a datetime series.

func NewSeriesTime

func NewSeriesTime(data []time.Time, nullMask []bool, makeCopy bool, ctx *Context) SeriesTime

Build a Time Series, if nullMask is nil then the series is not nullable

func (SeriesTime) Add

func (s SeriesTime) Add(other any) Series

func (SeriesTime) And

func (s SeriesTime) And(other any) Series

func (SeriesTime) Append

func (s SeriesTime) Append(v any) Series

Append appends a value or a slice of values to the series.

func (SeriesTime) Cast

Casts the series to a given type.

func (SeriesTime) Copy

func (s SeriesTime) Copy() Series

Copy the series.

func (SeriesTime) Data

func (s SeriesTime) Data() any

Return the elements of the series as a slice.

func (SeriesTime) DataAsNullable

func (s SeriesTime) DataAsNullable() any

Return the underlying data as a slice of NullableTime.

func (SeriesTime) DataAsString

func (s SeriesTime) DataAsString() []string

Return the underlying data as a slice of strings.

func (SeriesTime) Div

func (s SeriesTime) Div(other any) Series

func (SeriesTime) Eq

func (s SeriesTime) Eq(other any) Series

func (SeriesTime) Exp

func (s SeriesTime) Exp(other any) Series

func (SeriesTime) Filter

func (s SeriesTime) Filter(mask any) Series

Filters out the elements by the given mask. Mask can be SeriesBool, SeriesInt, bool slice or a int slice.

func (SeriesTime) Ge

func (s SeriesTime) Ge(other any) Series

func (SeriesTime) Get

func (s SeriesTime) Get(i int) any

Get the element at index i.

func (SeriesTime) GetAsString

func (s SeriesTime) GetAsString(i int) string

Get the element at index i as a string.

func (SeriesTime) GetContext

func (s SeriesTime) GetContext() *Context

Return the context of the series.

func (SeriesTime) GetError

func (s SeriesTime) GetError() string

Return the error message of the series.

func (SeriesTime) GetNullMask

func (s SeriesTime) GetNullMask() []bool

Return the null mask of the series.

func (SeriesTime) GetPartition

func (s SeriesTime) GetPartition() SeriesPartition

Return the partition of the series.

func (SeriesTime) GetTimeFormat

func (s SeriesTime) GetTimeFormat() string

Get the time format of the series.

func (SeriesTime) GroupBy

func (s SeriesTime) GroupBy(partition SeriesPartition) Series

func (SeriesTime) Gt

func (s SeriesTime) Gt(other any) Series

func (SeriesTime) HasNull

func (s SeriesTime) HasNull() bool

Return if the series has null values.

func (SeriesTime) IsError

func (s SeriesTime) IsError() bool

Return if the series is error.

func (SeriesTime) IsGrouped

func (s SeriesTime) IsGrouped() bool

Return if the series is grouped.

func (SeriesTime) IsNull

func (s SeriesTime) IsNull(i int) bool

Return if the element at index i is null.

func (SeriesTime) IsNullable

func (s SeriesTime) IsNullable() bool

Return if the series admits null values.

func (SeriesTime) IsSorted

func (s SeriesTime) IsSorted() SeriesSortOrder

Return if the series is sorted.

func (SeriesTime) Le

func (s SeriesTime) Le(other any) Series

func (SeriesTime) Len

func (s SeriesTime) Len() int

Return the number of elements in the series.

func (SeriesTime) Less

func (s SeriesTime) Less(i, j int) bool

func (SeriesTime) Lt

func (s SeriesTime) Lt(other any) Series

func (SeriesTime) MakeNonNullable

func (s SeriesTime) MakeNonNullable() Series

Make the series non-nullable.

func (SeriesTime) MakeNullable

func (s SeriesTime) MakeNullable() Series

Make the series nullable.

func (SeriesTime) Map

func (s SeriesTime) Map(f MapFunc) Series

Apply the given function to each element of the series.

func (SeriesTime) MapNull

func (s SeriesTime) MapNull(f MapFuncNull) Series

Apply the given function to each element of the series.

func (SeriesTime) Mod

func (s SeriesTime) Mod(other any) Series

func (SeriesTime) Mul

func (s SeriesTime) Mul(other any) Series

func (SeriesTime) Ne

func (s SeriesTime) Ne(other any) Series

func (SeriesTime) NullCount

func (s SeriesTime) NullCount() int

Return the number of null values in the series.

func (SeriesTime) Or

func (s SeriesTime) Or(other any) Series

func (SeriesTime) Set

func (s SeriesTime) Set(i int, v any) Series

Set the element at index i. The value v must be of type time.Time or NullableTime.

func (SeriesTime) SetNullMask

func (s SeriesTime) SetNullMask(mask []bool) Series

Set the null mask of the series.

func (SeriesTime) SetTimeFormat

func (s SeriesTime) SetTimeFormat(format string) Series

Set the time format of the series.

func (SeriesTime) Sort

func (s SeriesTime) Sort() Series

func (SeriesTime) SortRev

func (s SeriesTime) SortRev() Series

func (SeriesTime) Sub

func (s SeriesTime) Sub(other any) Series

func (SeriesTime) Swap

func (s SeriesTime) Swap(i, j int)

func (SeriesTime) Take

func (s SeriesTime) Take(params ...int) Series

Take the elements according to the given interval.

func (SeriesTime) Times

func (s SeriesTime) Times() []time.Time

Return the underlying data as a slice of time.Time.

func (SeriesTime) Type

func (s SeriesTime) Type() preludiometa.BaseType

Return the type of the series.

func (SeriesTime) TypeCard

func (s SeriesTime) TypeCard() preludiometa.BaseTypeCard

Return the type and cardinality of the series.

func (SeriesTime) UnGroup

func (s SeriesTime) UnGroup() Series

Ungroup the series.

type SeriesTimePartition

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

A SeriesTimePartition is a partition of a SeriesTime. Each key is a hash of a bool value, and each value is a slice of indices of the original series that are set to that value.

type SortParam

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

func Asc

func Asc(name string) SortParam

func Desc

func Desc(name string) SortParam

type StringFormatter

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

func NewStringFormatter

func NewStringFormatter() *StringFormatter

func (*StringFormatter) Compute

func (f *StringFormatter) Compute()

func (*StringFormatter) Format

func (f *StringFormatter) Format(width int, val any, isNa bool) string

func (*StringFormatter) GetMaxWidth

func (f *StringFormatter) GetMaxWidth() int

func (*StringFormatter) Push

func (f *StringFormatter) Push(val any)

func (*StringFormatter) SetUseLipGloss

func (f *StringFormatter) SetUseLipGloss(useLipGloss bool) *StringFormatter

type StringPool

type StringPool struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewStringPool

func NewStringPool() *StringPool

func (*StringPool) Get

func (sp *StringPool) Get(s string) *string

Get returns the address of the string if it exists in the pool, otherwise nil.

func (*StringPool) Len

func (sp *StringPool) Len() int

func (*StringPool) Put

func (sp *StringPool) Put(s string) *string

Put returns the address of the string if it exists in the pool, otherwise it adds it to the pool and returns its address.

func (*StringPool) PutSync

func (sp *StringPool) PutSync(s string) *string

PutSync returns the address of the string if it exists in the pool, otherwise it adds it to the pool and returns its address. This version is thread-safe.

func (*StringPool) SetNaText

func (sp *StringPool) SetNaText(s string) *StringPool

func (*StringPool) ToString

func (sp *StringPool) ToString() string

type XlsxReader

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

func NewXlsxReader

func NewXlsxReader(ctx *Context) *XlsxReader

func (*XlsxReader) Read

func (r *XlsxReader) Read() DataFrame

func (*XlsxReader) SetGuessDataTypeLen

func (r *XlsxReader) SetGuessDataTypeLen(guessDataTypeLen int) *XlsxReader

func (*XlsxReader) SetHeader

func (r *XlsxReader) SetHeader(header int) *XlsxReader

func (*XlsxReader) SetNullValues

func (r *XlsxReader) SetNullValues(nullValues bool) *XlsxReader

func (*XlsxReader) SetPath

func (r *XlsxReader) SetPath(path string) *XlsxReader

func (*XlsxReader) SetRows

func (r *XlsxReader) SetRows(rows int) *XlsxReader

func (*XlsxReader) SetSchema

func (r *XlsxReader) SetSchema(schema *preludiometa.Schema) *XlsxReader

func (*XlsxReader) SetSheet

func (r *XlsxReader) SetSheet(sheet string) *XlsxReader

type XlsxWriter

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

func NewXlsxWriter

func NewXlsxWriter() *XlsxWriter

func (*XlsxWriter) SetDataFrame

func (w *XlsxWriter) SetDataFrame(dataframe DataFrame) *XlsxWriter

func (*XlsxWriter) SetNaText

func (w *XlsxWriter) SetNaText(naText string) *XlsxWriter

func (*XlsxWriter) SetPath

func (w *XlsxWriter) SetPath(path string) *XlsxWriter

func (*XlsxWriter) SetSheet

func (w *XlsxWriter) SetSheet(sheet string) *XlsxWriter

func (*XlsxWriter) SetWriter

func (w *XlsxWriter) SetWriter(writer io.Writer) *XlsxWriter

func (*XlsxWriter) Write

func (w *XlsxWriter) Write() DataFrame

type XptReader

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

func NewXptReader

func NewXptReader(ctx *Context) *XptReader

func (*XptReader) Read

func (r *XptReader) Read() DataFrame

func (*XptReader) SetByteOrder

func (r *XptReader) SetByteOrder(byteOrder binary.ByteOrder) *XptReader

func (*XptReader) SetMaxObservations

func (r *XptReader) SetMaxObservations(maxObservations int) *XptReader

func (*XptReader) SetPath

func (r *XptReader) SetPath(path string) *XptReader

func (*XptReader) SetReader

func (r *XptReader) SetReader(reader io.Reader) *XptReader

func (*XptReader) SetVersion

func (r *XptReader) SetVersion(version XptVersionType) *XptReader

type XptVersionType

type XptVersionType uint8
const (
	XPT_VERSION_5 XptVersionType = iota + 5
	XPT_VERSION_6
	XPT_VERSION_8 XptVersionType = iota + 6
	XPT_VERSION_9
)

type XptWriter

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

func NewXptWriter

func NewXptWriter() *XptWriter

func (*XptWriter) SetByteOrder

func (w *XptWriter) SetByteOrder(byteOrder binary.ByteOrder) *XptWriter

func (*XptWriter) SetDataFrame

func (w *XptWriter) SetDataFrame(dataframe DataFrame) *XptWriter

func (*XptWriter) SetPath

func (w *XptWriter) SetPath(path string) *XptWriter

func (*XptWriter) SetVersion

func (w *XptWriter) SetVersion(version XptVersionType) *XptWriter

func (*XptWriter) SetWriter

func (w *XptWriter) SetWriter(writer io.Writer) *XptWriter

func (*XptWriter) Write

func (w *XptWriter) Write() DataFrame

Jump to

Keyboard shortcuts

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