Jan-29-2020, 04:23 PM
(Jan-29-2020, 04:18 PM)ThiefOfTime Wrote: Well the thing is that you probably want to do the max and min over a list of number right?
what you are building there are list of strings. For the max function it will work kind of since in comparison of strings a 7 is still greater than a 5 (alphabetically). For the min function the 1 (of -1.0000000e+00) is less than the 7 (of -75) therefore it is the minimum. So the script works right, but not like you want it to. try converting the strings you get out of the file to float:
for x in linesX: positionX.append(float(x.split()[X_column_number])) positionY.append(float(x.split()[Y_column_number]))Be careful though if you got an empty string from somewhere (it can happen) you get a problem converting
Yes that was exactly the problem. Thanks.