我有一个文件,其中的值采用科学记数法 3.198304894802781462e+00 。我想将这些转换为整数。我试过这个:
data = [int(float(number))
for line in open('data.txt', 'r')
for number in line.split()]
错误:
could not convert string to int: '1.874475383557408747e+01,3.627623082212955374e+00,9.037237691778705084