Matrix<T>.Aggregate Rows By<R, U>(R, Func<Vector<T>, U>) Method
Applies the specified aggregation function to the values
in each row grouped by the specified grouping row.
Definition
Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
C#
A new matrix with columns indexed by the unique elements of row groupingRowKey and values the result of aggregator applied to each grouping.
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
public Matrix<U> AggregateRowsBy<R, U>(
R groupingRowKey,
Func<Vector<T>, U> aggregator
)
Parameters
- groupingRowKey R
- The key of the grouping row.
- aggregator Func<Vector<T>, U>
- A function that transforms a vector of type T to a value of type U.
Type Parameters
- R
- The element type of the row index of the matrix.
- U
- The type of the result of the aggregation.
Return Value
Matrix<U>A new matrix with columns indexed by the unique elements of row groupingRowKey and values the result of aggregator applied to each grouping.