Created
September 2, 2019 02:19
-
-
Save iddan/0adc64de0468ccc54984708bbc5bd41d to your computer and use it in GitHub Desktop.
Transforms give iterables of tuples of iterables to tuples of iterables
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
from itertools import starmap, chain | |
def flat_unzip(iterable): | |
""" | |
Transforms given iterable of tuples of iterables to tuple of iterables | |
""" | |
return starmap(chain, zip(*data)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment