Trying calculate the median of a list, I tried many workflows but I did not succeed. I know there are external plugins for this, but I am very curious, if and how one can define the following condition in GH to calculate the median:
If the length of the list is odd, give the item in centre
else, give the average of the two centred items
Thank you very much @Dani_Abalde and @Michael_Pryor for the brilliant solutions.
What I specifically learned from you was the trick to connect 2 indexes to List Item in a way that it can result in one or two items, and the use of Stream Filter, which I was not aware of.
Hi, I am new to Python in Grasshopper but I am trying to replicate what you did. Could you explain a bit more how you set type hint etc, I put the exact same script but python shows syntax error.