w.wu
(W Wu)
June 8, 2019, 6:10pm
1
As you see, in the left panel, there are five unique numbers 1, 2, 3, 4, 5, and if you count them, the results are 3, 4, 2, 1, 5, which are in the right panel. I thought of the way to get the right panel in GH but failed. I think there may be a python to resolve it. count unique number.gh (3.5 KB)
Thanks for any help and suggestions!
results are 3, 4, 2, 1, 5
results are actually 34214 (even in your screenshot)
You can do this way additionally if you want to split them out into different branches:
count unique number - MP.gh (9.1 KB)
w.wu
(W Wu)
June 8, 2019, 6:19pm
4
Wow! That’s great job! Thank you, HS_Kim!!
w.wu
(W Wu)
June 8, 2019, 6:19pm
5
Thank you, Michael, for your kind help again!
w.wu
(W Wu)
June 8, 2019, 6:25pm
6
I just tried your code. Now I realize how powerful the “Sets” components are…
Thanks again!
w.wu
(W Wu)
June 8, 2019, 7:13pm
8
Thank you, Graham, for your suggestion!
Would you please give me more details? Actually I tried python also, but…
Ahh sorry I misread the question
Actually you need a counter:
from collections import Counter
my_counter = Counter(x)
w.wu
(W Wu)
June 8, 2019, 7:20pm
10
Yeah, that’s what I tried. But it doesn’t work well.
w.wu
(W Wu)
June 8, 2019, 7:26pm
11
By the way, how do you make the note for each component? That seems so convenient! Now I am always lost in the forest of cells…
w.wu
(W Wu)
June 8, 2019, 7:35pm
13
Got it! Thank you so much, HS_Kim!