CountDistinctBy

CountDistinctBy[{e1,e2,},f]

gives the number of distinct values of f[ei] that occur.

CountDistinctBy[f]

represents an operator form of CountDistinctBy that can be applied to an expression.

Details

Examples

open 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:

Applications  (1)

Extract the words that occur in the text of Alice in Wonderland:

Count the number of distinct words, ignoring case:

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.

Text

Wolfram Research (2014), CountDistinctBy, Wolfram Language function, https://reference.wolfram.com/language/ref/CountDistinctBy.html.

BibTeX

@misc{reference.wolfram_2020_countdistinctby, author="Wolfram Research", title="{CountDistinctBy}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/CountDistinctBy.html}", note=[Accessed: 12-April-2021 ]}

BibLaTeX

@online{reference.wolfram_2020_countdistinctby, organization={Wolfram Research}, title={CountDistinctBy}, year={2014}, url={https://reference.wolfram.com/language/ref/CountDistinctBy.html}, note=[Accessed: 12-April-2021 ]}

CMS

Wolfram Language. 2014. "CountDistinctBy." Wolfram Language & System Documentation Center. Wolfram Research. https://reference.wolfram.com/language/ref/CountDistinctBy.html.

APA

Wolfram Language. (2014). CountDistinctBy. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/CountDistinctBy.html