unique()

audeer.unique(sequence)[source]

Unique values in its original order.

This is an alternative to list(set(x)), which does not preserve the original order.

Parameters

sequence (Iterable) – sequence of values

Return type

List

Returns

unique values from x in order of appearance

Examples

>>> list(set([2, 2, 1]))
[1, 2]
>>> unique([2, 2, 1])
[2, 1]