Data Frame<R, C>.With Row Index Method
Definition
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.4
Overload List
With | Returns a new data frame using the specified column as the index. |
With | Returns a new data frame that uses the specified row index. |
With | Returns a new data frame using the specified columns as a hierarchical index. |
With | Returns a new data frame using the specified columns as a hierarchical index. |
WithRowIndex<R1>(C)
public DataFrame<R1, C> WithRowIndex<R1>(
C columnKey
)
Parameters
- columnKey C
- The key of the column.
Type Parameters
- R1
- The element type of the column.
Return Value
DataFrame<R1, C>A new data frame that contains all the columns in the current data frame indexed by columnKey.
Exceptions
Invalid | The column with key columnKey could not be cast to a vector with element type R1. |
Key | A column with key columnKey could not be found. |
WithRowIndex<R1>(Index<R1>)
public DataFrame<R1, C> WithRowIndex<R1>(
Index<R1> newRowIndex
)
Parameters
- newRowIndex Index<R1>
- The new row index.
Type Parameters
- R1
- The element type of the new row index.
Return Value
DataFrame<R1, C>Remarks
The length of the new index must be the same as the number of rows in the data frame. Otherwise a DimensionMismatchException is thrown.
Exceptions
Dimension | The length of newRowIndex is not equal to the number of rows in the data frame. |
WithRowIndex<R1, R2>(C, C)
public DataFrame<(R1 , R2 ), C> WithRowIndex<R1, R2>(
C column1Key,
C column2Key
)
Parameters
Type Parameters
- R1
- The element type of the first column.
- R2
- The element type of the second column.
Return Value
DataFrame<ValueTuple<R1, R2>, C>A new data frame that contains all the columns in the current data frame indexed by column1Key and column2Key.
Exceptions
Key | A column with key column1Key could not be found. -or- A column with key column2Key could not be found. |
Invalid | 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. |
WithRowIndex<R1, R2, R3>(C, C, C)
public DataFrame<(R1 , R2 , R3 ), C> WithRowIndex<R1, R2, R3>(
C column1Key,
C column2Key,
C column3Key
)
Parameters
- column1Key C
- The key of the first column.
- column2Key C
- The key of the second column.
- column3Key C
- The key of the second column.
Type Parameters
- R1
- The element type of the first column.
- R2
- The element type of the second column.
- R3
- The element type of the second column.
Return Value
DataFrame<ValueTuple<R1, R2, R3>, C>A new data frame that contains all the columns in the current data frame indexed by column1Key, column2Key, and column3Key.
Exceptions
Key | A column with key column1Key could not be found. -or- A column with key column2Key could not be found. -or- A column with key column3Key could not be found. |
Invalid | 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. -or- The column with key column3Key could not be cast to a vector with element type R3. |