I regularly find my self in the position of needing to slice lists with "sliding windows"
Like if I have the list {1,2,3,4,5,6,7,8} I would like to return {{1,2},{2,3},{3,4}..etc}
Just found this great way of doing it in dynamo. (I'm sure there are many ways of doing it, but quite simple this one anyways.)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from itertools import islice | |
a=IN[0] | |
n=IN[1] | |
z = (islice(a, i, None) for i in range(n)) | |
OUT=zip(*z) |
Hey there Jostein, there is a node List.Sublists that does this and a little more, you should give it a look. -Nick Curtis
SvarSlettTHANK YOU FOR THE INFORMATION
SvarSlettPLEASE VISIT US
autocad solutions IN USA
CASINO - 1 Mohegan Sun Blvd Uncasville, CT - Mapyro
SvarSlettHotel - This 5-star casino resort is a 2.3-minute walk from Mohegan 원주 출장안마 Sun Arena and 1 Mohegan 속초 출장샵 Sun Blvd Uncasville, Connecticut. Free WiFi 이천 출장마사지 is available at Rating: 8.4/10 · 2,314 reviews · 광명 출장샵 Price range: room rates from 동두천 출장샵 $119 per night (USD) - We Price Match!