0039 Group_by

Classify your data

The Enumerable module defines the group_by method for classifying data (tally being a special case). If there are only 2 groups, the partition method may be useful. ⚠️ partition always returns the true group first. Otherwise, the order is preserved. 0039-group_by_1.png

Links to Ruby documentation for group_by and partition.