-
Notifications
You must be signed in to change notification settings - Fork 7
Agg
The agg package provides all standard aggregation functions such as Sum
, Mean
, Std
etc. These operate over an IdxView
of an etable.Table
and work on both 1D and Tensor cells.
The Agg
method takes an "enum" identifier for which agg to perform.
The split
package has an Agg method (and variants) that applies the same aggregation over all the splits and stores the results within the Splits structure, which can then be saved back out to a Table
for viewing or subsequent processing, etc.
These methods enable summary data to be easily generated.
The Desc method applies all standard aggregation functions (Sum, Mean, Median, Min, Max, etc) to a given column of data, for a one-stop description of the data.
Just call the agg method directly -- it returns a slice to handle tensor-based columns, so you need to get the first element of return value if just a scalar column:
mean := agg.Mean(tix, "AvgSSE")[0]
Basic aggregation across splits, where byMethod
is the Splits
returned by split.GroupBy
:
split.Agg(byMethod, "orbital_period", agg.AggMedian)
pctErr := agg.PropIf(ix, "SSE", func(idx int, val float64) bool {
return val > 0
})[0]