Categorical Vector<T>.With Categories<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#
A new categorical vector with the same level indexes but newIndex as its category index.
Assembly: Numerics.NET (in Numerics.NET.dll) Version: 9.0.3
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
Argument | newIndex is null. |
Dimension | The length of newIndex is not equal to the length of the vector's CategoryIndex. |