def transpose(matrix: Iterable[Iterable]) -> Iterable[tuple]: 'Swap rows with columns for a 2-D array' return zip(*matrix)