Skip to main content

GroupBy

GroupBy[{elem1,elem2,…},f] gives an association that groups the elemi into lists associated with distinct keys f[elemi].

GroupBy[{elem1,elem2,…},fk->fv] groups the fv[elemi] according to the fk[elemi].

GroupBy[{elem1,elem2,…},{fs1,fs2,…}] groups into nested associations using fsi at level i.

GroupBy[{elem1,elem2,…},spec,red] applies the function red to reduce lists of values that are generated.

GroupBy[spec] represents an operator form of GroupBy that can be applied to an expression.

Please visit the official Wolfram Language Reference for more details and examples on core symbols.