[Tutor] nested list query

2011-06-27 Thread Vikram K
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_76136

[Tutor] reading very large files

2011-05-17 Thread Vikram K
I wish to read a large data file (file size is around 1.8 MB) and manipulate the data in this file. Just reading and writing the first 500 lines of this file is causing a problem. I wrote: fin = open('gene-GS00471-DNA_B01_ 1101_37-ASM.tsv') count = 0 for i in fin.readlines(): print i count

[Tutor] python hyperlinks question

2011-01-12 Thread Vikram K
I have a bunch of symbols in one of the columns in my program's output file (a csv file which can be opened in excel). I wish to add hyperlinks to each entry in this particular column in my output file. A sample symbol/entry in the specific column of interest in the output file is USP8 and it needs

[Tutor] string to list

2010-08-04 Thread Vikram K
Suppose i have this string: z = 'AT/CG' How do i get this list: zlist = ['A','T/C','G'] ___ Tutor maillist - Tutor@python.org To unsubscribe or change subscription options: http://mail.python.org/mailman/listinfo/tutor

[Tutor] nested list help

2010-07-27 Thread Vikram K
Suppose i have this nested list: >>> x [['NM100', 3, 4, 5, 6, 7], ['NM100', 10, 11, 12, 13], ['NM200', 15, 16, 17]] >>> for i in x: ... print i ... ['NM100', 3, 4, 5, 6, 7] ['NM100', 10, 11, 12, 13] ['NM200', 15, 16, 17] >>> how do i obtain from the above the following nested list: >>> z [['NM