CountDistinctBy

CountDistinctBy[{e1,e2,},f]
gives the number of distinct values of that occur.

CountDistinctBy[f]
represents an operator form of CountDistinctBy that can be applied to an expression.

DetailsDetails

ExamplesExamplesopen allclose all

Basic Examples  (2)Basic Examples  (2)

Count the number of distinct first parts:

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

Count the number of distinct first parts of the values of an association:

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

Use the operator form of CountDistinctBy:

In[1]:=
Click for copyable input
Out[1]=
Introduced in 2014
(10.0)