Skip to content

CountsBy

Like Counts, but groups by the value of a classifier function.

$ wo 'CountsBy[{1, 2, 3, 4, 5, 6}, OddQ]'
<|True -> 3, False -> 3|>