looping
Beema shafreen
beema.shafreen at gmail.com
Fri Nov 2 03:22:34 EDT 2007
hi everybody,
I have a file:
A_16_P21360207 304
A_14_P136880 783
A_16_P21360209 795
A_16_P21360210 173
A_16_P03641959 1177
A_16_P03641960 1944
A_16_P03641962 999
A_16_P03641963 3391
A_16_P41563649 3626
A_16_P03641964 180
A_16_P41563655 1216
A_16_P03641965 1170
A_16_P03641966 194
A_16_P21360229 290
my script:
import math
values_lis = []
fh = open('test5','r')
for line in fh.readlines():
data = line.strip().split('\t')
probe = data[0].strip()
values= data[1].strip()
value = values[0].strip()
value =float(values)
old = 0
if value >=old:
old = value
print '%s\t%s'%(probe,old)
I am aiming to remove the lowest values in the second column by iterating
one over the other....say for example 304 , is lesser than the
second row value 783 so i omit the first column first value.. in the same
case in the third row 795 is greater the 783 so i omit the 783the second
row... this to be carried out for attaining my destination... i have written
the sript but it doesnot not remove the lesser values...can you please chek
where i go wrong...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071102/2b37e098/attachment.html>
More information about the Python-list
mailing list