我正在尝试从 CSV 文件中的一组数字中找到最大值和最小值。对于某些行,我的代码不断为 Max 函数返回错误的数字。这是我的代码:
with open('Cortex_vs_Liver_trial.csv', newline='') as infile:
reader = csv.reader(infile)
for row in reader:
print(row)
print('The maximun is:', max(row))
print('The minimum is:', min(row))
Run Code Online (Sandbox Code Playgroud)
我的输出示例:
['86.21', '100.00', '96.30']
The maximun is: 96.30
The minimum is: 100.00
Run Code Online (Sandbox Code Playgroud)
我不确定我做错了什么。一些建议将不胜感激。