Skip to content

CountsBy

Status: Stable

documented, exercised by the test suite and/or worked examples, with no known limitations recorded.

Description

CountsBy[list, f]

Gives \<|f[x] -> count, ...|> tallying elements by f[x].

Examples (1)

Every input below was run against the current Mathilda build and its output recorded.

Basic examples (1)

In[1]:= CountsBy[Range[10], EvenQ]
Out[1]= <|False -> 5, True -> 5|>

Implementation notes

Attributes: Protected.

References