import csv
excel_cell = 6.48084E+11
cell = csv.reader(excel_cell)
print cell
>> cell = 6.48084E+11
# My desired output would be cell = 648084201003
我试图在python中使用csv阅读器来读取excel csv并返回一些值。单元格以科学记数显示,但如果单击单元格,则显示其值为648084201003
。有没有办法可以将其视为数字而不是科学记数法?
答案 0 :(得分:2)
csv.reader与问题完全无关。它返回项目的行:
>>> a = 6.48084E+11
>>> a
648084000000.0
>>> s = '{0:.0f}'.format(a)
>>> s
'648084000000'
>>> print s
648084000000
答案 1 :(得分:0)
示例:
>>> l = 6.48084E+11
>>> print l
6.48084e+11
>>> print repr(l)
648084000000.0