Grasshopper

algorithmic modeling for Rhino

hi,

 

is there a way to easily determine how often a certain value appears in a list?

for expample I have a list with angles like this

10

20

40

50

10

10

20

 

and I would want to know, quite simply, that "10" appear 3 times, 20 2 times, etc.

 

any ideas?
many thanks,

Peter

Views: 781

Replies to This Discussion

Hi Peter, you could use the Equals component and the Mass Addition Component provided that there wasn't a chance of rounding errors. This combination would added up all the True values to give the total number of times that an item was found.

If using multiple inputs don't forget to graft.

This should also still work.  It automatically sorts whatever data you feed into it and outputs unique values and the quantity of each value.

 

http://www.grasshopper3d.com/forum/topics/round-up-sort-quantities?...

works like a charm,

thanks,

Peter

works great also, thanks Danny!

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service