Itertools groupby do nothing but keyfunction sort correct

Hi all,

I tried to use the Itertools.groupby but unfortunatly the result is only a flat list and no sublists with the same X value.

I tried the also pt.Y and pt.X and pt.Y and for sorted it works thanks to helpful forum members…but i have no idea why groupby do nothing.

Thanks

I forgot to activate “List” input in the second python node (which convert python lists to grasshopper trees) so only a flat list came out.
Another problem seams to be the value tolerance for the keyfunc so i changed pt.X to round(pt.X) and now it works.

1 Like