Groups the rows of a data frame based on the specified key selector,
and returns the result of applying a function to the selected elements
of each group.
Namespace:
Extreme.DataAnalysis.Linq
Assembly:
Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.1
public static Vector<TResult> GroupBy<R, C, TKey, TElement, TResult>(
this DataFrame<R, C> frame,
Func<DataFrameRow<R, C>, TKey> keySelector,
Func<DataFrameRow<R, C>, TElement> elementSelector,
Func<TKey, IEnumerable<TElement>, TResult> resultSelector
)
<ExtensionAttribute>
Public Shared Function GroupBy(Of R, C, TKey, TElement, TResult) (
frame As DataFrame(Of R, C),
keySelector As Func(Of DataFrameRow(Of R, C), TKey),
elementSelector As Func(Of DataFrameRow(Of R, C), TElement),
resultSelector As Func(Of TKey, IEnumerable(Of TElement), TResult)
) As Vector(Of TResult)
public:
[ExtensionAttribute]
generic<typename R, typename C, typename TKey, typename TElement, typename TResult>
static Vector<TResult>^ GroupBy(
DataFrame<R, C>^ frame,
Func<DataFrameRow<R, C>^, TKey>^ keySelector,
Func<DataFrameRow<R, C>^, TElement>^ elementSelector,
Func<TKey, IEnumerable<TElement>^, TResult>^ resultSelector
)
[<ExtensionAttribute>]
static member GroupBy :
frame : DataFrame<'R, 'C> *
keySelector : Func<DataFrameRow<'R, 'C>, 'TKey> *
elementSelector : Func<DataFrameRow<'R, 'C>, 'TElement> *
resultSelector : Func<'TKey, IEnumerable<'TElement>, 'TResult> -> Vector<'TResult>
Parameters
- frame
- Type: Extreme.DataAnalysisDataFrameR, C
A data frame. - keySelector
- Type: SystemFuncDataFrameRowR, C, TKey
A function that maps rows in the data frame
to a key of type TKey. - elementSelector
- Type: SystemFuncDataFrameRowR, C, TElement
A function that maps rows in the data frame
to a value of type TElement. - resultSelector
- Type: SystemFuncTKey, IEnumerableTElement, TResult
A function that maps a group with key
of type TKey
and elements of type TElement
to a value of type TResult.
Type Parameters
- R
- The element type of the row index of the data frame.
- C
- The element type of the column index of the data frame.
- TKey
- The type of the key of the groups.
- TElement
- The type of the elements of the groups.
- TResult
- The element type of the result.
Return Value
Type:
VectorTResultA vector containing the result of applying
resultSelector to each group
of rows in
frame
where keys are evaluated using
keySelector
and values are evaluated using
elementSelector.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
DataFrameR,
C. 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).
Reference