Group list by value

Hie,
I am trying to group elements of a list. I like to create list with the elements who has the same value. I.e. one list wit the elements of value 5350, other with 4010,… Could you help me?
Regards.

List.GroupByKey

5 Likes

@Daan @FRAN1972 ,

these


nodes are the answer to all questions in the universe :slight_smile:

2 Likes

hello, you can plug in keys your list also for List.Group.ByKey :wink:

Cordially
christian.stan

2 Likes

How does the Object.Identity work in this .dyn?
What does it do? Why does 1.0 get rounded to 1?

1 Like

Object.Identity literally doesn’t do anything to the data. A code block with “x;” in it would result in the same. For the second question: I don’t know, maybe @jacob.small has an answer.

3 Likes

Yes Daan…thats normal and think is had to be that way but still a double so all good i think :wink:

4 Likes

Depending on your Dynamo build, this can just be a display thing more then a functional thing. Check the object.Type to confirm.

2 Likes

Thanks so much to all.

1 Like

While your solution definitely works, I’m not sure why you added to the object.Identity node.
Skipping that step works just as well.

2 Likes

@PauLtus ,

intresting, it is grouping by itself! :wink:

1 Like