Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

uneven chunks of array slices

from itertools import islice

def chunk(it, size):
    it = iter(it)
    return iter(lambda: tuple(islice(it, size)), ())
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #uneven #chunks #array #slices
ADD COMMENT
Topic
Name
4+2 =