Let's say I have a list of tuples consisting of [("ab", 1), ("ab", 2), ("ac", 3)]
Using a function groupwould split this list into a list of tuple lists:
[
[("ab", 1)],
[("ab", 2)],
[("ac", 3)]
]
How would you group a tuple ignoring one of the indices so that they are grouped based on one of the elements:
[
[("ab", 1), ("ab", 2)],
[("ac", 3]
]
In this case, you need a function groupBy?
source
share