Skip to content

IterTools.groupby doesn't group nonconsecutive elements together. #127

@dafnevk

Description

@dafnevk

When I execute the following code:

my_list = [ ["u",1], ["u",2], ["a",1], ["d", 1], ["a",2],["d",2]]
collect(IterTools.groupby(s->s[1], my_list))

I get as output:

 [["u", 1], ["u", 2]]
 [["a", 1]]
 [["d", 1]]
 [["a", 2]]
 [["d", 2]]

So it seems that the items with key a and d are not properly grouped together.

Environment:
Julia v1.10.9
itertools v1.10.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions