Skip to content

Tally

Counts occurrences of each distinct element.

$ wo 'Tally[{a, b, a, c, b, a}]'
{{a, 3}, {b, 2}, {c, 1}}
$ wo 'Tally[{1, 2, 1, 3}]'
{{1, 2}, {2, 1}, {3, 1}}
$ wo 'Tally[{x, x, x}]'
{{x, 3}}
$ wo 'Tally[{}]'
{}