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

Robert Kern robert.kern@gmail....
Fri Feb 12 11:41:29 CST 2010

On Fri, Feb 12, 2010 at 11:27, Christopher Barker <Chris.Barker@noaa.gov> wrote:
> Robert Kern wrote:
>> numpy.float is indeed Python's builtin float type (for obscure
>> historical reasons that I won't go into). However, in Python 2.5, at
>> least, the parsing of the string is offloaded to the standard C
>> function strtod().
> well, sort of -- it's pre-processed first, to add some numpy features,
> including parsing of NaN's. So it wouldn't be all that hard to add this
> too (well not that hard in the context of messing around in ugly C code,
> anyway).

Eh, what? numpy.float is Python's float. No numpy features at all.
There is some preprocessing, specifically to handle edge conditions
like .1, and Python 2.6 handles 'nan', but the important point is that
we don't control that code. You will have to submit a bug report to
Python in order to change that behavior.

That said, numpy.float64() is under our control, and you may submit a
patch to convert [dD] to [eE].

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco

More information about the NumPy-Discussion mailing list