Skip to content

Instantly share code, notes, and snippets.

@iddan
Created September 2, 2019 02:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save iddan/0adc64de0468ccc54984708bbc5bd41d to your computer and use it in GitHub Desktop.
Save iddan/0adc64de0468ccc54984708bbc5bd41d to your computer and use it in GitHub Desktop.
Transforms give iterables of tuples of iterables to tuples of iterables
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