Remembering most frequently appearing numbers in certain elements of lists

Mar 23, 2011 at 11:49am

Remembering most frequently appearing numbers in certain elements of lists

Hi,

what would be an easy way to report most frequent elements of many lists?

imagine

10 2 5
1 3 5
10 3 2

i want the answer

10 3 5

SO each element of a list would be checked for how frequently a certain number appears.

Thanks.

#55760
Mar 23, 2011 at 12:38pm

Hi,

>> i want the answer 10 3 5

Why not 10 3 5 2 ?

Here is one way to do it

– Pasted Max Patch, click to expand. –
#200468
Mar 23, 2011 at 3:28pm

Thanks, it’s a good solution, but I wanted to keep the length of the list, in my case 20. So I found a way by putting the following in the poly~ object with 20 instances and then packing the outputs:

– Pasted Max Patch, click to expand. –
#200469
Mar 23, 2011 at 3:31pm

where jb.mode reports the most frequent number here.

#200470

You must be logged in to reply to this topic.