[Baypiggies] partial flattening of list

Vikram kpguy at rediffmail.com
Tue Jul 27 08:50:36 CEST 2010



have the following:

>>> x
[['NM100', 1, 2], ['NM100', 3, 4], ['NM200', 5, 6]]
>>> for i in x:
... print i
...
['NM100', 1, 2]
['NM100', 3, 4]
['NM200', 5, 6]

------
how does one obtain list z such that

z = [['NM100',1,2,3,4],['NM200',5,6]]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20100727/9e8ee523/attachment.html>


More information about the Baypiggies mailing list