gives the number of distinct values of f[ei] that occur.
represents an operator form of CountDistinctBy that can be applied to an expression.
- CountDistinctBy[<|key1val1,key2val2,…|>, f] counts the distinct values of f[vali].
- CountDistinctBy[f][expr] is equivalent to CountDistinctBy[expr,f].
Examplesopen allclose all
Basic Examples (2)
Count the number of distinct first parts:
Count the number of distinct first parts of the values of an association:
Use the operator form of CountDistinctBy:
Properties & Relations (1)
CountDistinctBy[list,f] gives the same result as CountDistinct[f/@list]:
Wolfram Research (2014), CountDistinctBy, Wolfram Language function, https://reference.wolfram.com/language/ref/CountDistinctBy.html.
Wolfram Language. 2014. "CountDistinctBy." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CountDistinctBy.html.
Wolfram Language. (2014). CountDistinctBy. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CountDistinctBy.html