Re: numpy: handling float('NaN') different in XP vs. Linux

2008-06-16 Thread Robert Kern
John [H2O] wrote: Dan Bishop wrote: Python just uses the atof() function from the underlying C library. Some of them handle NaN's, and some of them don't. As a work around, how would I write this in list comprehension form: newlist=[] for i in range(len(v[1])):

Re: numpy: handling float('NaN') different in XP vs. Linux

2008-06-16 Thread John [H2O]
Dan Bishop wrote: > > > > Python just uses the atof() function from the underlying C library. > Some of them handle NaN's, and some of them don't. > > As a work around, how would I write this in list comprehension form: newlist=[] for i in range(len(v[1])): t

Re: numpy: handling float('NaN') different in XP vs. Linux

2008-06-14 Thread Terry Reedy
"Christian Heimes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] || I've fixed the issue for Python 2.6 and 3.0 a while ago. Mark and I have | spent a lot of time on fixing several edge cases regarding inf, nan and | numerical unsound functions in Python's math und cmath module. I

Re: numpy: handling float('NaN') different in XP vs. Linux

2008-06-14 Thread Christian Heimes
John [H2O] wrote: > I have a script: > > from numpy import float > OutD=[] > v=['3','43','23.4','NaN','43'] > OutD.append([float(i) for i in v[1]]) > > > On linux: > Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12) > [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 > [EMAIL P

Re: numpy: handling float('NaN') different in XP vs. Linux

2008-06-14 Thread John Machin
On Jun 14, 3:33 pm, "John [H2O]" <[EMAIL PROTECTED]> wrote: > John Machin wrote: > > > Avoid impolite astonishment; RTFloatingM instead: > > """ > > > HTH, > > John > > -- > > I guess the key here is that it is not an issue with Python, but C... can I > change 'the underlying C code?' The underlyi

Re: numpy: handling float('NaN') different in XP vs. Linux

2008-06-13 Thread John [H2O]
John Machin wrote: > > > Avoid impolite astonishment; RTFloatingM instead: > """ > > HTH, > John > -- > > I guess the key here is that it is not an issue with Python, but C... can I change 'the underlying C code?' if so, WFM should I read for that!? :p -- View this message in context:

Re: numpy: handling float('NaN') different in XP vs. Linux

2008-06-13 Thread John Machin
On Jun 14, 1:45 pm, "John [H2O]" <[EMAIL PROTECTED]> wrote: > I have a script: > > from numpy import float > OutD=[] > v=['3','43','23.4','NaN','43'] > OutD.append([float(i) for i in v[1]]) > > On linux: > Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12) > [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4

Re: numpy: handling float('NaN') different in XP vs. Linux

2008-06-13 Thread Dan Bishop
On Jun 13, 10:45 pm, "John [H2O]" <[EMAIL PROTECTED]> wrote: > I have a script: > > from numpy import float > OutD=[] > v=['3','43','23.4','NaN','43'] > OutD.append([float(i) for i in v[1]]) > > On linux: > Python 2.5.1 (r251:54863, Mar  7 2008, 04:10:12) > [GCC 4.1.3 20070929 (prerelease) (Ubuntu

numpy: handling float('NaN') different in XP vs. Linux

2008-06-13 Thread John [H2O]
I have a script: from numpy import float OutD=[] v=['3','43','23.4','NaN','43'] OutD.append([float(i) for i in v[1]]) On linux: Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12) [GCC 4.1.3 20070929 (prerelease) (Ubuntu 4.1.2-16ubuntu2)] on linux2 [EMAIL PROTECTED] analysis]$ python jnk.py [[3.0,