CountDistinct

CountDistinct[list]

gives the number of distinct elements that appear in list.

Details

  • CountDistinct[<|key1val1,key2val2,|>] gives the number of distinct vali.

Examples

open allclose all

Basic Examples  (2)

Count distinct elements in a list:

In[1]:=
Click for copyable input
Out[1]=

Count distinct values in an association:

In[1]:=
Click for copyable input
Out[1]=

Applications  (1)

Properties & Relations  (1)

See Also

CountDistinctBy  Count  DeleteDuplicates  Counts  DuplicateFreeQ  Length

Introduced in 2014
(10.0)