I don't need the laziness of itertools.groupby. I just want to group my list into a dict of lists as such:
dict([(a, list(b)) for a,b in itertools.groupby(mylist, mykeyfunc)])
Is there a standard function that already does this?
No, there's not a function included in the standard library to do this.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With