using zip for transpose
robin at reportlab.com
Thu Feb 21 04:52:18 EST 2019
In conversion of pandas dataframe to reportlab table I suggested using this expression
[list(x) for x in map(list,zip(*[df[i].values for i in df]))]
which effectively transposes the dataframe. However, it's not clear that this works for a large number of rows. Is the argument *A
for A a large list just copied into the zip *args; I suppose calling zip(A,A,......A[len(A)-1]) cannot be how this is done.
More information about the Python-list