Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

python csv reader scientific notations [closed]

Tags:

python

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

I am trying to use the csv reader in python to read an excel csv and return some of the values. The cell displays in scientific notations but if I click on the cell, it shows its value is 648084201003. Is there a way I can read this as digits rather than scientific notation?

like image 981
Aaron Phalen Avatar asked Jan 01 '26 04:01

Aaron Phalen


1 Answers

The csv.reader is completely unrelated to the problem. It returns rows of the items:

>>> a = 6.48084E+11
>>> a
648084000000.0
>>> s = '{0:.0f}'.format(a)
>>> s
'648084000000'
>>> print s
648084000000
like image 164
pepr Avatar answered Jan 03 '26 17:01

pepr



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!