[Baypiggies] nested list question

Vikram K kpguy1975 at gmail.com
Mon Jun 27 23:06:58 CEST 2011


Suppose i have the following nested list:

>>> x
[['19600894', '1', 'chr15_76136768', 'MISSENSE'], ['19600894', '2',
'chr15_76136768', 'MISSENSE'], ['18467762', '1', 'chr14_23354066',
'MISSENSE']]


How do i obtain from nested list x (given above), the following nested list
z:

>>> z
[['chr15_76136768', 'MISSENSE'], ['chr14_23354066', 'MISSENSE']]


------
In other words, if the third element of an element of x is the same, then i
wish to combine it into a single element.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/baypiggies/attachments/20110627/740b263f/attachment.html>


More information about the Baypiggies mailing list