Answers for "divide array into equal parts/slices python"

0

divide array into equal parts/slices python

import more_itertools as mt
#Create an array and use chunked() method
iterable = range(11)
n = 3
list(mt.chunked(iterable, n))
# [[0, 1, 2], [3, 4, 5], [6, 7, 8], [9, 10]]
Posted by: Guest on October-13-2021

Code answers related to "divide array into equal parts/slices python"

Python Answers by Framework

Browse Popular Code Answers by Language