Count the number of same items in a list

Hi,

Challenge:
i have a list with a lot of items. I would like to get;
A: the unique values
B: the number of items each unique value has.

It has to be fairly simple but I cant find it.

so for instance
2
2
2
5
6
6
6
6

I would like to get:
A: Unique values: 2,5,6

B: number of unique values;
2: 3x
5: 1x
6: 4x

Thank you in advance :slight_smile:

:slight_smile:

2020-04-22 18_20_00-Window

7 Likes

Thanks!:+1:

What if I have two lists, like if you have the dimensions of a piece? How can I make a count with this classification of 2 values?

Hello,
I think it is the same.

3 Likes

Thank you @11159

This is really helpful, thank you!
How would I get each of these quantities indexed back to their unique value?
Like in this set, how would I get the quantity of 3 to be assigned to each value of 2?
I’m trying to make a cut list script where each value has its qty. listed next to it.
Hope that makes sense. Thanks again.

Like this? Number of mesh faces per color (Z value):

1 Like