DataFrame<R, C>.GroupBy Method

Definition

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

Overload List

GroupBy<R1>(C) Returns a hierarchical index consisting of the current index grouped by the specified column.
GroupBy<R1>(IList<R1>) Returns a hierarchical grouping consisting of the current index grouped by the specified grouping values.
GroupBy<R1, R2>(C, C) Returns a hierarchical grouping on two columns.

GroupBy<R1>(C)

Returns a hierarchical index consisting of the current index grouped by the specified column.
C#
public IGrouping GroupBy<R1>(
	C columnKey
)

Parameters

columnKey  C
The name of the grouping column.

Type Parameters

R1
The element type of the grouping column.

Return Value

IGrouping
A hierarchical index.

GroupBy<R1>(IList<R1>)

Returns a hierarchical grouping consisting of the current index grouped by the specified grouping values.
C#
public IGrouping GroupBy<R1>(
	IList<R1> keys
)

Parameters

keys  IList<R1>
A list with elements of type R1 that contains the values to group on.

Type Parameters

R1
The element type of the grouping vector.

Return Value

IGrouping
A hierarchical index.

GroupBy<R1, R2>(C, C)

Returns a hierarchical grouping on two columns.
C#
public Grouping<(R1 , R2 )> GroupBy<R1, R2>(
	C column1Key,
	C column2Key
)

Parameters

column1Key  C
The key of the first grouping column.
column2Key  C
The key of the second grouping column.

Type Parameters

R1
The element type of the first grouping column.
R2
The element type of the second grouping column.

Return Value

Grouping<ValueTuple<R1, R2>>

Exceptions

KeyNotFoundException

column1Key could not be found in the column index.

-or-

column2Key could not be found in the column index.

InvalidCastException

The column with key column1Key could not be cast to a vector with element type R1.

-or-

The column with key column2Key could not be cast to a vector with element type R2.

See Also