Struct np.UniqueInverseResult
- Namespace
- NumSharp
- Assembly
- NumSharp.dll
The result of unique_inverse(NDArray): NumPy's UniqueInverseResult namedtuple
(values, inverse_indices). Converts implicitly to NDArray[],
Deconstructs (var (values, inv) = np.unique_inverse(x);) and indexes.
public readonly struct np.UniqueInverseResult : INDArrayCarrier
- Implements
- Inherited Members
Properties
this[int]
The k-th output in NumPy field order: values, inverse_indices.
public NDArray this[int index] { get; }
Parameters
indexint
Property Value
Length
Number of outputs (always 2).
public int Length { get; }
Property Value
inverse_indices
The indices into values that reconstruct the input, shaped like the input.
public NDArray inverse_indices { get; }
Property Value
values
The sorted unique values of the input.
public NDArray values { get; }
Property Value
Methods
Deconstruct(out NDArray, out NDArray)
Deconstructs into (values, inverse_indices).
public void Deconstruct(out NDArray values, out NDArray inverseIndices)
Parameters
ToArray()
Returns the outputs as an NDArray[] in NumPy field order.
public NDArray[] ToArray()
Returns
- NDArray[]
Operators
implicit operator NDArray[](UniqueInverseResult)
Exposes the outputs — the tuple NumPy's unique_inverse returns.
public static implicit operator NDArray[](np.UniqueInverseResult result)
Parameters
resultnp.UniqueInverseResult
Returns
- NDArray[]