def transpose(array):
    if not array:
        return []
    ret = []
    for c in range(len(array[0])):
        col = [row[c] for row in array]
        ret.append(col)
    return ret
Turn a list of lists sideways, making columns into rows and vice-versa.
dataset/ETHPy150Open mikeorr/WebHelpers2/webhelpers2/containers.py/transpose