Grouping.By Method

Definition

Namespace: Numerics.NET.DataAnalysis
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.8.0

Overload List

By<TKey>(ColumnSelector) Creates a dataframe grouping template that groups rows by one selected column.
By<TKey, C>(C) Creates a dataframe grouping template that groups rows by the column with the specified key.

By<TKey, C>(C)

Creates a dataframe grouping template that groups rows by the column with the specified key.
C#
public static GroupingTemplate<TKey> By<TKey, C>(
	C columnKey
)

Parameters

columnKey  C
The key of the grouping column.

Type Parameters

TKey
The type of the group keys produced when the template is bound.
C
The type of the dataframe column key.

Return Value

GroupingTemplate<TKey>
A grouping template that can be bound to a data frame.

Remarks

This overload creates a key-based column selector and does not bind immediately. Missing-column and key-type mismatch errors are reported when the template is bound.

Exceptions

ArgumentNullExceptioncolumnKey is null.

By<TKey>(ColumnSelector)

Creates a dataframe grouping template that groups rows by one selected column.
C#
public static GroupingTemplate<TKey> By<TKey>(
	ColumnSelector selector
)

Parameters

selector  ColumnSelector
A selector that must resolve to exactly one dataframe column.

Type Parameters

TKey
The type of the group keys produced when the template is bound.

Return Value

GroupingTemplate<TKey>
A grouping template that can be bound to a data frame.

Remarks

The factory does not inspect or bind to a data frame. The selector is resolved when Bind(IDataFrame) is called. Binding normalizes the selected column through the existing categorical-vector mechanism and returns a realized Grouping<TKey>.

The selector must resolve to exactly one column when the template is bound. Missing explicit keys and selector key-type mismatches use the normal selector resolution behavior.

This first implementation supports single-column dataframe grouping templates only.

Exceptions

ArgumentNullExceptionselector is null.

See Also