Simple: Y = zip (* X)
>>> X=[[1,2,3], [4,5,6]] >>> Y=zip(*X) >>> Y [(1, 4), (2, 5), (3, 6)]
EDIT: answer the questions in the comments about what zip (* X) means, here is an example from the python manual:
>>> range(3, 6)
So, when X - [[1,2,3], [4,5,6]] , zip(*X) - zip([1,2,3], [4,5,6])
source share