view lemuriformes/transpose.py @ 17:4793f99b73e0

[lemuriformes] utility functions
author Jeff Hammel <k0scist@gmail.com>
date Sun, 10 Dec 2017 17:42:52 -0800
parents
children
line wrap: on
line source

"""
transpose an 2D iterable of iterables in python
"""

def transpose(array, type=list):

    return map(type, zip(*array))