Data Frame<R, C>.Pivot Method
Definition
Namespace: Numerics.NET.DataAnalysis
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.2
Overload List
Pivot<R1, C1, T>(C, C, C) | Constructs a new data frame using the specified columns as row and column indexes. |
Pivot<R1, C1, T>(C, C, C, AggregatorGroup<T>) | Constructs a new data frame using the specified columns as row and column indexes and aggregates the values corresponding to each row-column pair. |
Pivot<R1, C1, T>(C, C, C)
Constructs a new data frame using the specified columns as row and column indexes.
public DataFrame<R1, C1> Pivot<R1, C1, T>(
C rows,
C columns,
C values
)
Parameters
- rows C
- The key of the column that contains the row indexes.
- columns C
- The key of the column that contains the column indexes.
- values C
- The key of the column that contains the values.
Type Parameters
- R1
- The element type of the column that contains the row indexes.
- C1
- The element type of the column that contains the column indexes.
- T
- The element type of the column that contains the values.
Return Value
DataFrame<R1, C1>A new data frame with rows indexed by the unique values in column rows, columns indexed by the unique values in column columns, and values the corresponding value in values.
Pivot<R1, C1, T>(C, C, C, AggregatorGroup<T>)
Constructs a new data frame using the specified columns as row and column indexes
and aggregates the values corresponding to each row-column pair.
public DataFrame<R1, C1> Pivot<R1, C1, T>(
C rows,
C columns,
C values,
AggregatorGroup<T> aggregator
)
Parameters
- rows C
- The key of the column that contains the row indexes.
- columns C
- The key of the column that contains the column indexes.
- values C
- The key of the column that contains the values.
- aggregator AggregatorGroup<T>
- An aggregator to apply to each group.
Type Parameters
- R1
- The element type of the column that contains the row indexes.
- C1
- The element type of the column that contains the column indexes.
- T
- The element type of the column that contains the values.
Return Value
DataFrame<R1, C1>A new data frame with rows indexed by the unique values in the column with key rows, columns indexed by the unique values in the column with key columns, and values the result of aggregating the values in the column with key values grouped by the keys in these columns using aggregator.
Exceptions
Key | The value rows could not be found in the data frame's column index. -or- The value columns could not be found in the data frame's column index. -or- The value values could not be found in the data frame's column index. |
Invalid | The column with key rows could not be cast to type R1. -or- The column with key columns could not be cast to type C1. |