Jan-29-2020, 04:08 PM
Hello everybody.
I am trying to find the max and min values of the first two columns of a matrix. I have written the following code
Can someone tell me what am I doing wrong?
Thanks.
I am trying to find the max and min values of the first two columns of a matrix. I have written the following code
f = open('XdataTXT.txt','r') linesX=f.readlines() X_column_number = 0 positionX=[] Y_column_number = 1 positionY=[] for x in linesX: positionX.append(x.split()[X_column_number]) positionY.append(x.split()[Y_column_number]) f.close() print(positionX) print(max(positionX)) print(min(positionX))However, my output does not look like what it should. The max(positionX) is returned as it should, but the min(positionX) doesn't, since the output is
Output:-1.0000000e+00
but the smallest element is -75. Aditionally, if the same is done using the second column, positionY, the both outputs look as they should.Can someone tell me what am I doing wrong?
Thanks.