Table of Contents

Struct np.UniqueAllResult

Namespace
NumSharp
Assembly
NumSharp.dll

The result of unique_all(NDArray): NumPy's UniqueAllResult namedtuple (values, indices, inverse_indices, counts). Converts implicitly to NDArray[], Deconstructs (var (values, indices, inv, counts) = np.unique_all(x);) and indexes ([k]).

public readonly struct np.UniqueAllResult : INDArrayCarrier
Implements
Inherited Members

Properties

this[int]

The k-th output in NumPy field order: values, indices, inverse_indices, counts.

public NDArray this[int index] { get; }

Parameters

index int

Property Value

NDArray

Length

Number of outputs (always 4).

public int Length { get; }

Property Value

int

counts

The number of times each unique value appears in the input.

public NDArray counts { get; }

Property Value

NDArray

indices

The index of the first occurrence (in the flattened input) of each unique value.

public NDArray indices { get; }

Property Value

NDArray

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, out NDArray, out NDArray)

Deconstructs into (values, indices, inverse_indices, counts).

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

Parameters

values NDArray
indices NDArray
inverseIndices NDArray
counts NDArray

ToArray()

Returns the outputs as an NDArray[] in NumPy field order.

public NDArray[] ToArray()

Returns

NDArray[]

Operators

implicit operator NDArray[](UniqueAllResult)

Exposes the outputs — the tuple NumPy's unique_all returns.

public static implicit operator NDArray[](np.UniqueAllResult result)

Parameters

result np.UniqueAllResult

Returns

NDArray[]