Table of Contents

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

index int

Property Value

NDArray

Length

Number of outputs (always 2).

public int Length { get; }

Property Value

int

inverse_indices

The indices into values that reconstruct the input, shaped like the input.

public NDArray inverse_indices { get; }

Property Value

NDArray

values

The sorted unique values of the input.

public NDArray values { get; }

Property Value

NDArray

Methods

Deconstruct(out NDArray, out NDArray)

Deconstructs into (values, inverse_indices).

public void Deconstruct(out NDArray values, out NDArray inverseIndices)

Parameters

values NDArray
inverseIndices NDArray

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

result np.UniqueInverseResult

Returns

NDArray[]