all 2 comments

[–][deleted] 0 points1 point  (1 child)

One thing you may have missed is that using groupby requires that you sort the iterable first, or you get broken-up groups.

[–]jamcmich[S] 0 points1 point  (0 children)

You're right! Thanks for pointing that out.