Number of occurences in a list

Hey, I currently have a long list of items, many of which occurs multiple times. I would like to transform it to a shorter list which contains each unique item + the number of occurences.

Hi and welcome to the forum!

Do you need the elements as well?
This is a way to do this.

1 Like

First of all, thank you for the warm welcome and your reply! :slight_smile:

Yes this is a great beginning of what I’d like to do. Now when the elements are sorted I’d like to know the amount of instances in each sublist.

Instead of a list of sublists I want a list with numbers, [30,14,7,24…] and so forth.

I don’t know what you mean:

1 Like

Oh, yours seem to work exactly like I need it to. I was just confused because my list.count only gives me the amount of sublists like such.

Thanks for your continued support!

You need to set the nodes List.FirstItem and List.Count to lacing longest
(rightclick and lacing)

1 Like

Yes! Thank you, should have consulted you long ago :stuck_out_tongue: Thanks for the help!!

Haha glad I could help! :slight_smile:

1 Like