Hi,
I have written this code to generate the maximun number from a number of coloumns (say 4 coloumns) in a list. The code is not handling negative number well and so keep generating the negaive number to be greater eg -8 > 5 which is wrong. Why is this happening?
file_in = open( 'cont.dat',"r")
data_in=file_in.readlines()
file_in.close()
coloumn=[]
for line in data_in:
data=line.split()
ncoverage=len(data)
maxval=data[0]
maxid=0
for j in xrange(0,ncoverage,1):
if data[j]>= maxval:
maxval=data[j]
print maxval