Group tuple and list maintaining order python -


i have list , tuple. know tuples not meant modified, need join tuple list keeping order between two, example..

l1 = [(166l,), (155l,)] l2 = [0.74, 0.25] 

i

l3 = [[166,0.74],[155,0.25]] 

i tried sorted(l1+l2) did not work giving

[0.25, 0.7, (155l,), (166l,)] 

>>> l1 = [(166l,), (155l,)] >>> l2 = [0.74, 0.25] >>> zip([x x, in l1], l2) [(166l, 0.74), (155l, 0.25)] >>> map(list, zip([x x, in l1], l2)) [[166l, 0.74], [155l, 0.25]] 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -