Created
August 13, 2020 19:55
-
-
Save alexeygrigorev/3a9ae7eb692be0069278254297ce036e to your computer and use it in GitHub Desktop.
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
def make_batches(seq, n): | |
result = [] | |
for i in range(0, len(seq), n): | |
batch = seq[i:i+n] | |
result.append(batch) | |
return result |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment