Atom

collection.unique()

Collects the first occurrence of each value.

Signature

collection.unique(iterable)

Parameters

One iterable.

Returns

New array.

Behavior

Uses Atom equality and preserves traversal order. Each NaN is retained.

Errors

Unsupported input, invalid view or allocation failure.

Example

Atom
use collection
assert(count(collection.unique([1, 1.0, 2])) == 2)