"Vikram K" <[email protected]> wrote
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']]
Since it is not clear what exact algorithm you are following to derive
the second from the first I'll take the brute force sinplistic route:
[x[0][-2:],x[-1][-2:]]
Now, I'm pretty sure you have a more complex algorithm that just
using the first and last elements of the list, but since I don't know
what it is, this will have to do...
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor