Im trying to find the max/min values of the first column in an array short of importing anything
max = 0
min = 100000
for row in _file_in.readlines():
Data = row.split(',') # Load first column
if (Data[0] > max):
max = Data[0]
if (Data[0] < min):
min = Data[0]
print min, max
I initialize max to 0 and min to some arbitrarily large number. My resulting code is able to print out the max # but the minimum # is printing out 100000 which is incorrect
Data[0]is a string. You should convert that to number. Perhaps useintmin,maxas variable names as they clash with Python's builtins.