CountsBy

CountsBy[{e1,e2,},f]
gives an association whose keys are the distinct values of the , and whose values give the number of times these values appear.

CountsBy[f]
represents an operator form of CountsBy that can be applied to an expression.

DetailsDetails

  • CountsBy[{e1,e2,},f] gives an association whose keys are in the order in which the corresponding first appear.
  • CountsBy[f][expr] is equivalent to CountsBy[expr,f].
Introduced in 2014
(10.0)