How to change the major order of lists in python? -


i have list of n lists, each sub-list containing m elements.

how create list of m lists n elements each, containing n-th elements initial lists?

let's have this

mylist = [[1, 2, 3],[4, 5, 6]] 

i want have

[[1, 4],[2, 5],[3, 6]] 

performance important. have sublists of millions of elements (though, 1 dimension small: 1.000.000 x 8 )

this give tuples, it's trivial extend contain lists:

zip(*mylist) 

i.e.

[list(i) in zip(*mylist)] 

Comments

Popular posts from this blog

SVG stroke-linecap doesn't work for circles in Firefox? -

routes - Laravel 4 Wildcard Routing to Different Controllers -

cross browser - XSLT namespace-alias Not Working in Firefox or Chrome -