GroupBy¶
Groups elements of a list according to a function.
A list of classifiers sub-groups level by level:
$ wo '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}}|>|>
A third argument reduces the innermost groups: