Skip to content

Instantly share code, notes, and snippets.

@iddan

iddan/flat_unzip.py

Created Sep 2, 2019
Embed
What would you like to do?
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