Skip to content

Esta página también está en español.

Léela en español

このページは日本語でも読めます。

日本語で読む

本页也有简体中文版本。

阅读简体中文版本

tally function

How often each element occurs: a list of element and count pairs.

How to write it

tally(list)

list
The list. Takes a list.

Examples

  • tally⁡([a,b,a])=(a2b1)\displaystyle \operatorname{tally}(\left[ a, b, a \right]) = \begin{pmatrix} a & 2 \\ b & 1 \end{pmatrix}
    tally([a, b, a])

    In the solver, tally([a, b, a]) gives [[a, 2], [b, 1]].

    Open in the solver
  • thread

    Apply a function to corresponding elements of lists.

  • take

    The first elements of a list.

  • total

    Sum of the elements of a list.

  • table

    Build a list by evaluating an expression over one or more ranges.

  • union

    The elements in any of some lists, each once, in order.

  • subsets

    All the sublists of a list that keep its order, as a list.