CategoricalVector<T>.WithCategories<U> Method

Returns a new categorical vector that uses the specified index to encode values.

Definition

Namespace: Numerics.NET
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
C#
public CategoricalVector<U> WithCategories<U>(
	IList<U> newIndex
)

Parameters

newIndex  IList<U>
A list of values that make up the category index of the new vector.

Type Parameters

U
The element type of the new index.

Return Value

CategoricalVector<U>
A new categorical vector with the same level indexes but newIndex as its category index.

Exceptions

ArgumentNullException

newIndex is null.

DimensionMismatchException

The length of newIndex is not equal to the length of the vector's CategoryIndex.

See Also