Grouping.Group Method

Definition

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

Overload List

Group<TInput>(IEnumerable<TInput>) Returns a grouping by the unique elements in a sequence.
Group<TInput>(IList<TInput>) Returns a grouping by the unique elements in a list.
Group<TInput>(IEnumerable<TInput>, IEqualityComparer<TInput>) Returns a grouping by the unique elements in a sequence using the specified comparer to determine equality.
Group<TInput>(IList<TInput>, IEqualityComparer<TInput>) Returns a grouping by the unique elements in a list using the specified comparer to determine equality.

Group<TInput>(IEnumerable<TInput>)

Returns a grouping by the unique elements in a sequence.
C#
public static Grouping<TInput> Group<TInput>(
	this IEnumerable<TInput> keys
)

Parameters

keys  IEnumerable<TInput>
A list.

Type Parameters

TInput
The type of the elements of the sequence.

Return Value

Grouping<TInput>
A grouping of the elements of keys and indexed by the unique elements in keys.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<TInput>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Group<TInput>(IList<TInput>)

Returns a grouping by the unique elements in a list.
C#
public static Grouping<TInput> Group<TInput>(
	this IList<TInput> keys
)

Parameters

keys  IList<TInput>
A list.

Type Parameters

TInput
The type of the elements of the list.

Return Value

Grouping<TInput>
A grouping of the elements of keys and indexed by the unique elements in keys.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IList<TInput>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Group<TInput>(IEnumerable<TInput>, IEqualityComparer<TInput>)

Returns a grouping by the unique elements in a sequence using the specified comparer to determine equality.
C#
public static Grouping<TInput> Group<TInput>(
	this IEnumerable<TInput> keys,
	IEqualityComparer<TInput> comparer
)

Parameters

keys  IEnumerable<TInput>
A list.
comparer  IEqualityComparer<TInput>
The comparer used to determine whether two keys are equal.

Type Parameters

TInput
The type of the elements of the sequence.

Return Value

Grouping<TInput>
A grouping of the elements of keys and indexed by the unique elements in keys.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IEnumerable<TInput>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

Group<TInput>(IList<TInput>, IEqualityComparer<TInput>)

Returns a grouping by the unique elements in a list using the specified comparer to determine equality.
C#
public static Grouping<TInput> Group<TInput>(
	this IList<TInput> keys,
	IEqualityComparer<TInput> comparer
)

Parameters

keys  IList<TInput>
A list.
comparer  IEqualityComparer<TInput>
The comparer used to determine whether two keys are equal.

Type Parameters

TInput
The type of the elements of the list.

Return Value

Grouping<TInput>
A grouping of the elements of keys and indexed by the unique elements in keys.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type IList<TInput>. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

See Also