Click or drag to resize

FrameViewGroupBy Method (String, FuncFrameView, IReadOnlyDictionaryString, Object)

Groups the data by the values in the given column, and computes aggregate quantities for each group.

Namespace:  Meta.Numerics.Data
Assembly:  Meta.Numerics (in Meta.Numerics.dll) Version: 4.1.4
Syntax
public FrameTable GroupBy(
	string groupByColumnName,
	Func<FrameView, IReadOnlyDictionary<string, Object>> aggregator
)

Parameters

groupByColumnName
Type: SystemString
The name of the column to group by.
aggregator
Type: SystemFuncFrameView, IReadOnlyDictionaryString, Object
A function that computes the aggregate quantities.

Return Value

Type: FrameTable
A new data frame containing the aggregates for each group.
Remarks

The first column of the returned FrameTable has the same name as the original groupByColumnName and contains all the distinct values of that column in the original view. There is an additional column for each dictionary entry returned by aggregator, whose name is the returned key and whose values are values returned for each group.

The function that computes the aggregate receives a FrameView containing all the rows in the group. To produce aggregate results, it can use values in any of the columns. Each invocation of the aggregator must return the same keys and values for the same keys must be of the same type. (Values for different keys may be of different types.) Aggregate column names are taken from the keys and storage types are inferred from the returned values.

To produce just one aggregate value, you may find it simpler and more efficient to use the GroupBy(String, FuncFrameView, IReadOnlyDictionaryString, Object) overload.

See Also