DataFrame<R, C>.WithColumnIndex<C1> Method

Returns a new data frame that relabels the columns using the specified index.

Definition

Namespace: Numerics.NET.DataAnalysis
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 10.9.0
C#
public DataFrame<R, C1> WithColumnIndex<C1>(
	IEnumerable<C1> newIndex
)

Parameters

newIndex  IEnumerable<C1>
The new index of column labels.

Type Parameters

C1
The element type of the new column index.

Return Value

DataFrame<R, C1>
A new data frame.

Remarks

The new data frame contains the same logical columns in the same ordinal positions with new typed column keys. Dataframe-owned column metadata is copied by ordinal so it follows the columns to the new keys. The returned data frame owns independent metadata sidecars.

Exceptions

ArgumentNullExceptionnewIndex is null.
DimensionMismatchExceptionThe new index length differs from the number of columns.

See Also