Re: [Tutor] Mapping elements in various lists

2006-04-05 Thread Srinivas Iyyer
Hi Alan, Thank you again. I did not give a try by using dictionary power. It works now. Thanks again for tip. -srini. dida = {} for m in nbat: cols = m.split('\t') old = cols[0] dida.setdefault(old,[]).append(cols[1]) lista = ndat.split('\n') result = [] for i in li

Re: [Tutor] Mapping elements in various lists - walking over lists andtheir elements

2006-04-05 Thread Alan Gauld
> One of the proble is that, Contig27915_RC is seen > associated with many XM entries in nbat. However, > with the above script I could replace only once in > xta. I could not print Contig27915_RC with many XM_ > guys in nbat. How can this be done. > > Finally, this whole process seems to be more

Re: [Tutor] Mapping elements in various lists -

2006-04-05 Thread Srinivas Iyyer
Sorry for the very long email. and I my brain is dead to create some related generic snippet. Thus, I shrunk the string and lists into as short as I could. apologies again. srini --- Srinivas Iyyer <[EMAIL PROTECTED]> wrote: > Dear Tutors, > I have a huge string and 2 lists. List A consists >

[Tutor] Mapping elements in various lists - walking over lists and their elements

2006-04-05 Thread Srinivas Iyyer
Dear Tutors, I have a huge string and 2 lists. List A consists of tabed elements, where first tab represents entry somewhere in string(ndat). ndat has 'Contig27915_RC' and List A [nbat]has 'Contig27915_RC\tXM_945977'. List B [nmlist]has elements, for instance ['XM_945977\tNM_152513']. Now my tas