CategoricalVector<T>.WithCategories<U> Method

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

Definition

Namespace: Extreme.Mathematics
Assembly: Extreme.Numerics (in Extreme.Numerics.dll) Version: 8.1.23
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