Created
April 22, 2020 12:15
-
-
Save palawer/c51291792b379050b147715244656cec to your computer and use it in GitHub Desktop.
This file contains hidden or 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
from itertools import zip_longest | |
def grouper(iterable, n=1000, fillvalue=None): | |
args = [iter(iterable)] * n | |
return zip_longest(*args, fillvalue=fillvalue) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment