Wolfram Computation Meets Knowledge

UniqueCases

Contributed by: Taliesin Beynon

Similar to Cases, but removes duplicates

ResourceFunction["UniqueCases"][expr,patt]

is like Cases, but returns deduplicated results

Examples

Basic Examples

Find unique integer cases.

In[1]:=
ResourceFunction["UniqueCases"][{1, 1, 2.}, _Integer]
Out[1]=

Compare with Cases.

In[2]:=
Cases[{1, 1, 2.}, _Integer]
Out[2]=

Resource History