WLJS LogoWLJS Notebook

Commonest

Commonest[list] gives a list of the elements that are the most common in list.

Commonest[list, n] gives a list of the n most common elements in list.

Examples

Find the most common element:

Commonest[{a, b, a, c, a, b}]
(* {a} *)

Find the 2 most common:

Commonest[{a, b, a, c, a, b, c, c}, 2]
(* {a, c} *)

Please visit the official Wolfram Language Reference for more details.

On this page