agg

package
v2.0.0-dev0.0.19 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2024 License: BSD-3-Clause Imports: 6 Imported by: 1

README

agg

Docs: GoDoc

This package provides aggregation functions operating on IndexView indexed views of etable.Table data, along with standard AggFunc functions that can be used at any level of aggregation from etensor on up.

The main functions use names to specify columns, and *Index and *Try versions are available that operate on column indexes and return errors, respectively.

See the tsragg package for functions that operate directly on a etensor.Tensor without the index view indirection.

Documentation

Overview

Package agg provides aggregation functions operating on IndexView indexed views of etable.Table data, along with standard AggFunc functions that can be used at any level of aggregation from etensor on up.

The main functions use names to specify columns, and *Index and *Try versions are available that operate on column indexes and return errors, respectively.

See tsragg package for functions that operate directly on a etensor.Tensor without the indexview indirection.

Index

Constants

This section is empty.

Variables

DescAggs are all the standard aggregates

DescAggsND are all the standard aggregates for n-dimensional (n > 1) data -- cannot do quantiles

Functions

func Agg

func Agg(ix *etable.IndexView, colNm string, ag Aggs) []float64

Agg returns aggregate according to given agg type applied to all non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. valid names are: Count, Sum, Var, Std, Sem, VarPop, StdPop, SemPop, Min, Max, SumSq (case insensitive) If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func AggIndex

func AggIndex(ix *etable.IndexView, colIndex int, ag Aggs) []float64

AggIndex returns aggregate according to given agg type applied to all non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. valid names are: Count, Sum, Var, Std, Sem, VarPop, StdPop, SemPop, Min, Max, SumSq, 25%, 1Q, Median, 50%, 2Q, 75%, 3Q (case insensitive) Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func AggTry

func AggTry(ix *etable.IndexView, colNm string, ag Aggs) ([]float64, error)

AggTry returns aggregate according to given agg type applied to all non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. valid names are: Count, Sum, Var, Std, Sem, VarPop, StdPop, SemPop, Min, Max, SumSq (case insensitive) If col name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func AggsName

func AggsName(ag Aggs) string

AggsName returns the name of the Aggs varaible without the Agg prefix..

func Count

func Count(ix *etable.IndexView, colNm string) []float64

Count returns the count of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func CountFunc

func CountFunc(idx int, val float64, ag float64) float64

CountFunc is an AggFunc that computes number of elements (non-Null, non-NaN) Use 0 as initial value.

func CountIf

func CountIf(ix *etable.IndexView, colNm string, iffun IfFunc) []float64

CountIf returns the count of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func CountIfIndex

func CountIfIndex(ix *etable.IndexView, colIndex int, iffun IfFunc) []float64

CountIfIndex returns the count of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func CountIfTry

func CountIfTry(ix *etable.IndexView, colNm string, iffun IfFunc) ([]float64, error)

CountIfTry returns the count of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func CountIndex

func CountIndex(ix *etable.IndexView, colIndex int) []float64

CountIndex returns the count of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func CountTry

func CountTry(ix *etable.IndexView, colNm string) ([]float64, error)

CountTry returns the count of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Desc

func Desc(ix *etable.IndexView, colNm string) *etable.Table

Desc returns a table of standard descriptive aggregates of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message.

func DescAll

func DescAll(ix *etable.IndexView) *etable.Table

DescAll returns a table of standard descriptive aggregates for all numeric columns in given table, operating over all non-Null, non-NaN elements in each column.

func DescIndex

func DescIndex(ix *etable.IndexView, colIndex int) *etable.Table

DescIndex returns a table of standard descriptive aggregates of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index.

func DescTry

func DescTry(ix *etable.IndexView, colNm string) (*etable.Table, error)

Desc returns a table of standard descriptive aggregate aggs of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Max

func Max(ix *etable.IndexView, colNm string) []float64

Max returns the maximum of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func MaxFunc

func MaxFunc(idx int, val float64, ag float64) float64

MaxFunc is an AggFunc that computes a max aggregate. use -math.MaxFloat64 for initial agg value.

func MaxIndex

func MaxIndex(ix *etable.IndexView, colIndex int) []float64

MaxIndex returns the maximum of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func MaxTry

func MaxTry(ix *etable.IndexView, colNm string) ([]float64, error)

MaxTry returns the maximum of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Mean

func Mean(ix *etable.IndexView, colNm string) []float64

Mean returns the mean of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func MeanIndex

func MeanIndex(ix *etable.IndexView, colIndex int) []float64

MeanIndex returns the mean of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func MeanTables

func MeanTables(dts []*etable.Table) *etable.Table

MeanTables returns an etable.Table with the mean values across all float columns of the input tables, which must have the same columns but not necessarily the same number of rows.

func MeanTry

func MeanTry(ix *etable.IndexView, colNm string) ([]float64, error)

MeanTry returns the mean of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Median

func Median(ix *etable.IndexView, colNm string) []float64

Median returns the median of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func MedianIndex

func MedianIndex(ix *etable.IndexView, colIndex int) []float64

MedianIndex returns the median of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func MedianTry

func MedianTry(ix *etable.IndexView, colNm string) ([]float64, error)

MedianTry returns the median of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Min

func Min(ix *etable.IndexView, colNm string) []float64

Min returns the minimum of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func MinFunc

func MinFunc(idx int, val float64, ag float64) float64

MinFunc is an AggFunc that computes a min aggregate. use math.MaxFloat64 for initial agg value.

func MinIndex

func MinIndex(ix *etable.IndexView, colIndex int) []float64

MinIndex returns the minimum of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func MinTry

func MinTry(ix *etable.IndexView, colNm string) ([]float64, error)

MinTry returns the minimum of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func PctIf

func PctIf(ix *etable.IndexView, colNm string, iffun IfFunc) []float64

PctIf returns the percentage (0-100) of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func PctIfIndex

func PctIfIndex(ix *etable.IndexView, colIndex int, iffun IfFunc) []float64

PctIfIndex returns the percentage (0-100) of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func PctIfTry

func PctIfTry(ix *etable.IndexView, colNm string, iffun IfFunc) ([]float64, error)

PctIfTry returns the percentage (0-100) of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Prod

func Prod(ix *etable.IndexView, colNm string) []float64

Prod returns the product of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func ProdFunc

func ProdFunc(idx int, val float64, ag float64) float64

Prodfunc is an AggFunc that computes a product aggregate. use 1 as initial value.

func ProdIndex

func ProdIndex(ix *etable.IndexView, colIndex int) []float64

ProdIndex returns the product of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func ProdTry

func ProdTry(ix *etable.IndexView, colNm string) ([]float64, error)

ProdTry returns the product of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func PropIf

func PropIf(ix *etable.IndexView, colNm string, iffun IfFunc) []float64

PropIf returns the proportion (0-1) of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func PropIfIndex

func PropIfIndex(ix *etable.IndexView, colIndex int, iffun IfFunc) []float64

PropIfIndex returns the proportion (0-1) of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func PropIfTry

func PropIfTry(ix *etable.IndexView, colNm string, iffun IfFunc) ([]float64, error)

PropIfTry returns the proportion (0-1) of true return values for given IfFunc on non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Q1

func Q1(ix *etable.IndexView, colNm string) []float64

Q1 returns the first quartile of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Q1Index

func Q1Index(ix *etable.IndexView, colIndex int) []float64

Q1Index returns the first quartile of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Q1Try

func Q1Try(ix *etable.IndexView, colNm string) ([]float64, error)

Q1Try returns the first quartile of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Q3

func Q3(ix *etable.IndexView, colNm string) []float64

Q3 returns the third quartile of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Q3Index

func Q3Index(ix *etable.IndexView, colIndex int) []float64

Q3Index returns the third quartile of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Q3Try

func Q3Try(ix *etable.IndexView, colNm string) ([]float64, error)

Q3Try returns the third quartile of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Quantiles

func Quantiles(ix *etable.IndexView, colNm string, qs []float64) []float64

Quantiles returns the given quantile(s) of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Column must be a 1d Column -- returns nil for n-dimensional columns. qs are 0-1 values, 0 = min, 1 = max, .5 = median, etc. Uses linear interpolation. Because this requires a sort, it is more efficient to get as many quantiles as needed in one pass.

func QuantilesIndex

func QuantilesIndex(ix *etable.IndexView, colIndex int, qs []float64) []float64

QuantilesIndex returns the given quantile(s) of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Column must be a 1d Column -- returns nil for n-dimensional columns. qs are 0-1 values, 0 = min, 1 = max, .5 = median, etc. Uses linear interpolation. Because this requires a sort, it is more efficient to get as many quantiles as needed in one pass.

func QuantilesTry

func QuantilesTry(ix *etable.IndexView, colNm string, qs []float64) ([]float64, error)

QuantilesTry returns the given quantile(s) of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name If name not found, error message is returned. Column must be a 1d Column -- returns nil for n-dimensional columns. qs are 0-1 values, 0 = min, 1 = max, .5 = median, etc. Uses linear interpolation. Because this requires a sort, it is more efficient to get as many quantiles as needed in one pass.

func Sem

func Sem(ix *etable.IndexView, colNm string) []float64

Sem returns the sample standard error of the mean of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. Sample sem is normalized by 1/(n-1) -- see SemPop version for 1/n normalization. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func SemIndex

func SemIndex(ix *etable.IndexView, colIndex int) []float64

SemIndex returns the sample standard error of the mean of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Sample sem is normalized by 1/(n-1) -- see SemPop version for 1/n normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func SemPop

func SemPop(ix *etable.IndexView, colNm string) []float64

SemPop returns the standard error of the mean of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. population sem is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func SemPopIndex

func SemPopIndex(ix *etable.IndexView, colIndex int) []float64

SemPopIndex returns the population standard error of the mean of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. population sem is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func SemPopTry

func SemPopTry(ix *etable.IndexView, colNm string) ([]float64, error)

SemPopTry returns the standard error of the mean of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. population sem is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func SemTry

func SemTry(ix *etable.IndexView, colNm string) ([]float64, error)

SemTry returns the sample standard error of the mean of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. Sample sem is normalized by 1/(n-1) -- see SemPop version for 1/n normalization. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Std

func Std(ix *etable.IndexView, colNm string) []float64

Std returns the sample std deviation of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. Sample std deviation is normalized by 1/(n-1) -- see StdPop version for 1/n normalization. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func StdIndex

func StdIndex(ix *etable.IndexView, colIndex int) []float64

StdIndex returns the sample std deviation of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Sample std deviation is normalized by 1/(n-1) -- see StdPop version for 1/n normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func StdPop

func StdPop(ix *etable.IndexView, colNm string) []float64

StdPop returns the population std deviation of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. population std dev is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func StdPopIndex

func StdPopIndex(ix *etable.IndexView, colIndex int) []float64

StdPopIndex returns the population std deviation of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. population std dev is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func StdPopTry

func StdPopTry(ix *etable.IndexView, colNm string) ([]float64, error)

StdPopTry returns the population std deviation of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. population std dev is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func StdTry

func StdTry(ix *etable.IndexView, colNm string) ([]float64, error)

StdTry returns the sample std deviation of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. Sample std deviation is normalized by 1/(n-1) -- see StdPop version for 1/n normalization. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Sum

func Sum(ix *etable.IndexView, colNm string) []float64

Sum returns the sum of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func SumFunc

func SumFunc(idx int, val float64, ag float64) float64

SumFunc is an AggFunc that computes a sum aggregate. use 0 as initial value.

func SumIndex

func SumIndex(ix *etable.IndexView, colIndex int) []float64

SumIndex returns the sum of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func SumSq

func SumSq(ix *etable.IndexView, colNm string) []float64

SumSq returns the sum-of-squares of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func SumSqFunc

func SumSqFunc(idx int, val float64, ag float64) float64

SumSqFunc is an AggFunc that computes a sum-of-squares aggregate. use 0 as initial value.

func SumSqIndex

func SumSqIndex(ix *etable.IndexView, colIndex int) []float64

SumSqIndex returns the sum-of-squares of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func SumSqTry

func SumSqTry(ix *etable.IndexView, colNm string) ([]float64, error)

SumSqTry returns the sum-of-squares of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func SumTry

func SumTry(ix *etable.IndexView, colNm string) ([]float64, error)

SumTry returns the sum of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func Var

func Var(ix *etable.IndexView, colNm string) []float64

Var returns the sample variance of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. Sample variance is normalized by 1/(n-1) -- see VarPop version for 1/n normalization. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func VarIndex

func VarIndex(ix *etable.IndexView, colIndex int) []float64

VarIndex returns the sample variance of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. Sample variance is normalized by 1/(n-1) -- see VarPop version for 1/n normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func VarPop

func VarPop(ix *etable.IndexView, colNm string) []float64

VarPop returns the population variance of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. population variance is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. If name not found, nil is returned -- use Try version for error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func VarPopIndex

func VarPopIndex(ix *etable.IndexView, colIndex int) []float64

VarPopIndex returns the population variance of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column index. population variance is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func VarPopTry

func VarPopTry(ix *etable.IndexView, colNm string) ([]float64, error)

VarPopTry returns the population variance of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. population variance is normalized by 1/n -- see Var version for 1/(n-1) sample normalization. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

func VarTry

func VarTry(ix *etable.IndexView, colNm string) ([]float64, error)

VarTry returns the sample variance of non-Null, non-NaN elements in given IndexView indexed view of an etable.Table, for given column name. Sample variance is normalized by 1/(n-1) -- see VarPop version for 1/n normalization. If name not found, returns error message. Return value is size of each column cell -- 1 for scalar 1D columns and N for higher-dimensional columns.

Types

type Aggs

type Aggs int32 //enums:enum

Aggs is a list of different standard aggregation functions, which can be used to choose an aggregation function

const (
	// Count of number of elements
	AggCount Aggs = iota

	// Sum of elements
	AggSum

	// Product of elements
	AggProd

	// Min minimum value
	AggMin

	// Max maximum value
	AggMax

	// Mean mean value
	AggMean

	// Var sample variance (squared diffs from mean, divided by n-1)
	AggVar

	// Std sample standard deviation (sqrt of Var)
	AggStd

	// Sem sample standard error of the mean (Std divided by sqrt(n))
	AggSem

	// VarPop population variance (squared diffs from mean, divided by n)
	AggVarPop

	// StdPop population standard deviation (sqrt of VarPop)
	AggStdPop

	// SemPop population standard error of the mean (StdPop divided by sqrt(n))
	AggSemPop

	// Median middle value in sorted ordering
	AggMedian

	// Q1 first quartile = 25%ile value = .25 quantile value
	AggQ1

	// Q3 third quartile = 75%ile value = .75 quantile value
	AggQ3

	// SumSq sum of squares
	AggSumSq
)
const AggsN Aggs = 16

AggsN is the highest valid value for type Aggs, plus one.

func AggsValues

func AggsValues() []Aggs

AggsValues returns all possible values for the type Aggs.

func (Aggs) Desc

func (i Aggs) Desc() string

Desc returns the description of the Aggs value.

func (Aggs) Int64

func (i Aggs) Int64() int64

Int64 returns the Aggs value as an int64.

func (Aggs) MarshalText

func (i Aggs) MarshalText() ([]byte, error)

MarshalText implements the encoding.TextMarshaler interface.

func (*Aggs) SetInt64

func (i *Aggs) SetInt64(in int64)

SetInt64 sets the Aggs value from an int64.

func (*Aggs) SetString

func (i *Aggs) SetString(s string) error

SetString sets the Aggs value from its string representation, and returns an error if the string is invalid.

func (Aggs) String

func (i Aggs) String() string

String returns the string representation of this Aggs value.

func (*Aggs) UnmarshalText

func (i *Aggs) UnmarshalText(text []byte) error

UnmarshalText implements the encoding.TextUnmarshaler interface.

func (Aggs) Values

func (i Aggs) Values() []enums.Enum

Values returns all possible values for the type Aggs.

type IfFunc

type IfFunc func(idx int, val float64) bool

IfFunc is used for the *If aggregators -- counted if it returns true

type IndexViewAggFunc

type IndexViewAggFunc func(ix *etable.IndexView, colNm string) []float64

IndexViewAggFunc is an aggregation function operating on IndexView, taking a column name arg

type IndexViewAggFuncIndex

type IndexViewAggFuncIndex func(ix *etable.IndexView, colIndex int) []float64

IndexViewAggFuncIndex is an aggregation function operating on IndexView, taking a column index arg

type IndexViewAggFuncTry

type IndexViewAggFuncTry func(ix *etable.IndexView, colIndex int) ([]float64, error)

IndexViewAggFuncTry is an aggregation function operating on IndexView, taking a column name arg, returning an error message

Jump to

Keyboard shortcuts

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