Groups elements of a list according to a function.
GroupBy[{elem1, elem2, …}, f]
GroupBy[{elem1, elem2, …}, fk -> f v]
GroupBy[{elem1, elem2, …}, {fs1, fs2, …}]
GroupBy[{elem1, elem2, …}, spec, red]
GroupBy[spec]
GroupBy[{{a, b}, {a, c}, {b, c}}, First]
→ <|a -> {{a, b}, {a, c}}, b -> {{b, c}}|>GroupBy[{{1, a, x}, {1, b, y}, {2, a, z}}, {First, #[[2]] &}]
→ <|1 -> <|a -> {{1, a, x}}, b -> {{1, b, y}}|>, 2 -> <|a -> {{2, a, z}}|>|>GroupBy[{{1, a, x}, {1, b, y}, {2, a, z}, {1, a, w}}, {First, #[[2]] &}, Length]
→ <|1 -> <|a -> 2, b -> 1|>, 2 -> <|a -> 1|>|>