Created
March 19, 2020 15:46
-
-
Save nim4n136/0c57943bc5cfd3d62cf99e8e3961d0e7 to your computer and use it in GitHub Desktop.
Chunk array python
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
# chunk data array | |
def chunks(lst, n_max): | |
n = max(1, n_max) | |
return (lst[i:i+n] for i in range(0, len(lst), n_max)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment