cfdm.Data.unique

Data.unique()[source]

The unique elements of the data.

The unique elements are sorted into a one dimensional array. with no missing values.

New in version (cfdm): 1.7.0

Returns
Data

The unique elements.

Examples

>>> d = cfdm.Data([[4, 2, 1], [1, 2, 3]], 'metre')
>>> d.unique()
<Data(4): [1, ..., 4] metre>
>>> d[1, -1] = cfdm.masked
>>> d.unique()
<Data(3): [1, 2, 4] metre>