Counts

Counts[list]

gives an association whose keys are the distinct elements of list, and whose values give the number of times those elements appear in list.

Details

  • Counts[list] gives an association whose keys are in the same order as they first occur as elements of list.

Examples

Basic Examples  (2)

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

See Also

CountsBy  Tally  BinCounts  Merge  GroupBy  Count  Gather  Commonest  DuplicateFreeQ  KeySort  Sort  CharacterCounts  WordCounts  WordCloud

Introduced in 2014
(10.0)