Counting unique values in a list
Hi guys,
Picked up Nodebox again after a 2 year intermezzo. Been working
my way through the tutorials (which is going well).
But, please, help me out with this:
How am I able to count every unique value within a list?
I have two lists. They both consist out of years (see attachment). I'm trying to connect the values of both lists through a line. It can only work when I'm able to count the unique values, I think.
Thanks in advance!
Mark
Comments are currently closed for this discussion. You can start a new one.
Keyboard shortcuts
Generic
? | Show this help |
---|---|
ESC | Blurs the current field |
Comment Form
r | Focus the comment reply box |
---|---|
^ + ↩ | Submit the comment |
You can use Command ⌘
instead of Control ^
on Mac
Support Staff 1 Posted by Frederik De Ble... on 30 Jan, 2014 04:43 PM
You could try a distinct node, which filters out all double values, and
then add a count node afterwards.
F
On Thu, Jan 30, 2014, at 16:18, Mark wrote:
2 Posted by mark on 30 Jan, 2014 10:53 PM
Hi Frederik,
Sorry, I guess I have to refrase myself.
I want to count the amount of appearances of one value inside a list. The amount of appearances of every - what I called - "unique" value.
Is it possible?
Thanx again.
Mark
Support Staff 3 Posted by Frederik De Ble... on 04 Feb, 2014 09:33 AM
The easiest way to do this is using a custom node, which I've attached here, that counts the distinct elements.
Best,
F
mark closed this discussion on 05 Feb, 2014 03:03 PM.