agg

package
v1.0.32 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2021 License: BSD-3-Clause Imports: 8 Imported by: 115

Documentation

Overview

Package agg provides aggregation functions operating on IdxView 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 *Idx and *Try versions are available that operate on column indexes and return errors, respectively.

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

View Source
var KiT_Aggs = kit.Enums.AddEnum(AggsN, kit.NotBitFlag, nil)

Functions

func Agg

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

Agg returns aggregate according to given agg type applied to all non-Null, non-NaN elements in given IdxView 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 AggIdx

func AggIdx(ix *etable.IdxView, colIdx int, ag Aggs) []float64

AggIdx returns aggregate according to given agg type applied to all non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string, ag Aggs) ([]float64, error)

AggTry returns aggregate according to given agg type applied to all non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

Count returns the count of non-Null, non-NaN elements in given IdxView 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 CountIdx

func CountIdx(ix *etable.IdxView, colIdx int) []float64

CountIdx returns the count of non-Null, non-NaN elements in given IdxView 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 CountIf

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

CountIf returns the count of true return values for given IfFunc on non-Null, non-NaN elements in given IdxView 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 CountIfIdx

func CountIfIdx(ix *etable.IdxView, colIdx int, iffun IfFunc) []float64

CountIfIdx returns the count of true return values for given IfFunc on non-Null, non-NaN elements in given IdxView 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.IdxView, 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 IdxView 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 CountTry

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

CountTry returns the count of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) *etable.Table

Desc returns a table of standard descriptive aggregates of non-Null, non-NaN elements in given IdxView 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.IdxView) *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 DescIdx

func DescIdx(ix *etable.IdxView, colIdx int) *etable.Table

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

func DescTry

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

Desc returns a table of standard descriptive aggregate aggs of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

Max returns the maximum of non-Null, non-NaN elements in given IdxView 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 MaxIdx

func MaxIdx(ix *etable.IdxView, colIdx int) []float64

MaxIdx returns the maximum of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

MaxTry returns the maximum of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

Mean returns the mean of non-Null, non-NaN elements in given IdxView 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 MeanIdx

func MeanIdx(ix *etable.IdxView, colIdx int) []float64

MeanIdx returns the mean of non-Null, non-NaN elements in given IdxView 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 MeanTry

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

MeanTry returns the mean of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

Median returns the median of non-Null, non-NaN elements in given IdxView 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 MedianIdx

func MedianIdx(ix *etable.IdxView, colIdx int) []float64

MedianIdx returns the median of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

MedianTry returns the median of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

Min returns the minimum of non-Null, non-NaN elements in given IdxView 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 MinIdx

func MinIdx(ix *etable.IdxView, colIdx int) []float64

MinIdx returns the minimum of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

MinTry returns the minimum of non-Null, non-NaN elements in given IdxView 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.IdxView, 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 IdxView 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 PctIfIdx

func PctIfIdx(ix *etable.IdxView, colIdx int, iffun IfFunc) []float64

PctIfIdx returns the percentage (0-100) of true return values for given IfFunc on non-Null, non-NaN elements in given IdxView 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.IdxView, 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 IdxView 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.IdxView, colNm string) []float64

Prod returns the product of non-Null, non-NaN elements in given IdxView 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 ProdIdx

func ProdIdx(ix *etable.IdxView, colIdx int) []float64

ProdIdx returns the product of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

ProdTry returns the product of non-Null, non-NaN elements in given IdxView 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.IdxView, 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 IdxView 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 PropIfIdx

func PropIfIdx(ix *etable.IdxView, colIdx int, iffun IfFunc) []float64

PropIfIdx returns the proportion (0-1) of true return values for given IfFunc on non-Null, non-NaN elements in given IdxView 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.IdxView, 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 IdxView 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.IdxView, colNm string) []float64

Q1 returns the first quartile of non-Null, non-NaN elements in given IdxView 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 Q1Idx

func Q1Idx(ix *etable.IdxView, colIdx int) []float64

Q1Idx returns the first quartile of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

Q1Try returns the first quartile of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

Q3 returns the third quartile of non-Null, non-NaN elements in given IdxView 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 Q3Idx

func Q3Idx(ix *etable.IdxView, colIdx int) []float64

Q3Idx returns the third quartile of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

Q3Try returns the third quartile of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string, qs []float64) []float64

Quantiles returns the given quantile(s) of non-Null, non-NaN elements in given IdxView 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 QuantilesIdx

func QuantilesIdx(ix *etable.IdxView, colIdx int, qs []float64) []float64

QuantilesIdx returns the given quantile(s) of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string, qs []float64) ([]float64, error)

QuantilesTry returns the given quantile(s) of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

Sem returns the sample standard error of the mean of non-Null, non-NaN elements in given IdxView 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 SemIdx

func SemIdx(ix *etable.IdxView, colIdx int) []float64

SemIdx returns the sample standard error of the mean of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

SemPop returns the standard error of the mean of non-Null, non-NaN elements in given IdxView 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 SemPopIdx

func SemPopIdx(ix *etable.IdxView, colIdx int) []float64

SemPopIdx returns the population standard error of the mean of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

SemPopTry returns the standard error of the mean of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

SemTry returns the sample standard error of the mean of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

Std returns the sample std deviation of non-Null, non-NaN elements in given IdxView 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 StdIdx

func StdIdx(ix *etable.IdxView, colIdx int) []float64

StdIdx returns the sample std deviation of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

StdPop returns the population std deviation of non-Null, non-NaN elements in given IdxView 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 StdPopIdx

func StdPopIdx(ix *etable.IdxView, colIdx int) []float64

StdPopIdx returns the population std deviation of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

StdPopTry returns the population std deviation of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

StdTry returns the sample std deviation of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

Sum returns the sum of non-Null, non-NaN elements in given IdxView 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 SumIdx

func SumIdx(ix *etable.IdxView, colIdx int) []float64

SumIdx returns the sum of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

SumSq returns the sum-of-squares of non-Null, non-NaN elements in given IdxView 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 SumSqIdx

func SumSqIdx(ix *etable.IdxView, colIdx int) []float64

SumSqIdx returns the sum-of-squares of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

SumSqTry returns the sum-of-squares of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

SumTry returns the sum of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

Var returns the sample variance of non-Null, non-NaN elements in given IdxView 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 VarIdx

func VarIdx(ix *etable.IdxView, colIdx int) []float64

VarIdx returns the sample variance of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) []float64

VarPop returns the population variance of non-Null, non-NaN elements in given IdxView 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 VarPopIdx

func VarPopIdx(ix *etable.IdxView, colIdx int) []float64

VarPopIdx returns the population variance of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

VarPopTry returns the population variance of non-Null, non-NaN elements in given IdxView 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.IdxView, colNm string) ([]float64, error)

VarTry returns the sample variance of non-Null, non-NaN elements in given IdxView 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 int

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

	AggsN
)

func (*Aggs) FromString

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

func (Aggs) MarshalJSON

func (ev Aggs) MarshalJSON() ([]byte, error)

func (Aggs) String

func (i Aggs) String() string

func (*Aggs) UnmarshalJSON

func (ev *Aggs) UnmarshalJSON(b []byte) error

type IdxViewAggFunc

type IdxViewAggFunc func(ix *etable.IdxView, colIdx int) []float64

IdxViewAggFunc is an aggregation function operating on IdxView, taking a column name arg

type IdxViewAggFuncIdx

type IdxViewAggFuncIdx func(ix *etable.IdxView, colIdx int) []float64

IdxViewAggFuncIdx is an aggregation function operating on IdxView, taking a column index arg

type IdxViewAggFuncTry

type IdxViewAggFuncTry func(ix *etable.IdxView, colIdx int) ([]float64, error)

IdxViewAggFuncTry is an aggregation function operating on IdxView, taking a column name arg, returning an error message

type IfFunc

type IfFunc func(idx int, val float64) bool

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

Jump to

Keyboard shortcuts

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