Chunk Array

Split an array into smaller chunks of a specified size.

Code

General
[arr[i:i+size] for i in range(0, len(arr), size)]

Parameters

Array to chunk

Size of each chunk

Server

More Python Snippets