Tally

Tally[list]
tallies the elements in list, listing all distinct elements together with their multiplicities.

Tally[list,test]
uses test to determine whether pairs of elements should be considered equivalent, and gives a list of the first representatives of each equivalence class, together with their multiplicities.

DetailsDetails

  • Tally[list] lists distinct elements in the order they appear in list.
  • Tally[list] is equivalent to Tally[list,SameQ].
Introduced in 2007
(6.0)