[Numpy-discussion] Re ading scientific notation using D instead of E

Robert C. ricitron@mac....
Fri Feb 12 09:46:54 CST 2010


I am trying to read a large amount of data that is output in scientific
notation using D instead of E. After searching around I found a thread that
implied numpy already has the capability to do this: 
http://stackoverflow.com/questions/1959210/python-scientific-notation-using-d-instead-of-e
http://stackoverflow.com/questions/1959210/python-scientific-notation-using-d-instead-of-e 

However, this does not work for me. I get:

>>> numpy.float('1.23D+04')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ValueError: invalid literal for float(): 1.23D+04

Was this capability lost in more recent versions of numpy?

I would rather not have to do a search and replace every time I read in
data.

Thanks.
-- 
View this message in context: http://old.nabble.com/Reading-scientific-notation-using-D-instead-of-E-tp27565041p27565041.html
Sent from the Numpy-discussion mailing list archive at Nabble.com.



More information about the NumPy-Discussion mailing list