New submission from ricitron ricit...@mac.com:
I would like to be able to read in data that uses scientific notation with a D
instead of an E. This is possible on windows and other builds, but not on Mac
OSX.
example:
float('1.23D+04')
Traceback (most recent call last):
File stdin, line 1,
Eric Smith e...@trueblade.com added the comment:
str-float conversions have been reworked in 2.7 and 3.1. The 'D' exponent will
not on any platform starting with those versions.
So, this would be a non-platform specific feature request.
--
assignee: ronaldoussoren -
components:
Eric Smith e...@trueblade.com added the comment:
That was supposed to say:
The 'D' exponent will not work on any platform starting with those versions.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7919
Mark Dickinson dicki...@gmail.com added the comment:
Out of curiosity, where are your data coming from?
For Python, this seems like a needless complication. It should be simple
enough to replace the 'D's with 'E's prior to passing the strings to float.
I notice that some varieties of Lisp
ricitron ricit...@mac.com added the comment:
I am running python 2.5.4. While it works on linux and windows, it does not
work on mac.
Fortran doubles are output using the D notation. If I am importing a large
amount of data, I would rather not do a search and replace every time before
Mark Dickinson dicki...@gmail.com added the comment:
Sorry, I'm -1 on this: outside Fortran, using 'E' for the exponent marker
seems to be near universal. It just doesn't seem worth adding the extra
complication to the Python code, or going through all the various places that
expect an 'e'
Mark Dickinson dicki...@gmail.com added the comment:
I would rather not do a search and replace every time before reading in the
data.
There's no need to do a search and replace *before* reading the data: read the
data first, then have Python do the replace for you before passing each
Eric Smith e...@trueblade.com added the comment:
Unless and until we implement 'd' exponents, we should add a test to make sure
they don't work. That they ever worked on any platform was a surprise.
--
Eric.
--
title: reading scientific notation using d instead of e on max osx -
Mark Dickinson dicki...@gmail.com added the comment:
Done in r78166 (trunk), r78167 (py3k).
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7919
___
Eric Smith e...@trueblade.com added the comment:
I'm -1 on this, too. Closing.
--
resolution: - rejected
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue7919
10 matches
Mail list logo