472,357 Members | 2,138 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,357 software developers and data experts.

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

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
[john@andLinux analysis]$ python jnk.py
[[3.0, 43.0, 23.399999999999999, nan, 43.0]]

On XP:
Python 2.5 (r25:51908, Mar 9 2007, 17:40:28) [MSC v.1310 32 bit (Intel)]
Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\analysis>C:\Python25\python.exe jnk.py
Traceback (most recent call last):
File "jnk.py", line 4, in <module>
OutD.append([float(i) for i in v])
ValueError: invalid literal for float(): NaN
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.

Christian

Jun 27 '08 #1
0 972

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Dave Smithz | last post by:
Hi There, I have taken over someone else's PHP code and am quite new to PHP. I made some changes and have implemented them to a live environment fine so far. However, I now want to setup a...
5
by: Andreas Beyer | last post by:
Hi, How do I find out if NaN, infinity and alike is supported on the current python platform? I could do the following: try: nan = float('NaN') have_nan = True except ValueError: have_nan =...
1
by: Jonathan Fong | last post by:
Hi, I am seeking advice about handling different versions of APIs of office which I am writing a plug-in application for it in C# language. Which is the best way to do? 1. Resolving...
2
by: Jack Russell | last post by:
Some countries use comma instead of point as the decimal separator (and presumably there are other variations) If one has a set of ascii files containing numbers stored in one culture is there...
22
by: Andy McDonagh | last post by:
Dear python experts, I am new to python and this site, so I apologize if this is off topic (i.e. is it a SciPy question?). I will try to demonstrate my problem below:...
1
by: hansman | last post by:
i would like to make a search page in which i can search google, and yahoo. The user may specify what site they with to use by a drop down menu, how can i code the page so that the options in teh...
6
by: John [H2O] | last post by:
I have a script: from numpy import float OutD= v= OutD.append(]) On linux: Python 2.5.1 (r251:54863, Mar 7 2008, 04:10:12)
0
by: Terry Reedy | last post by:
"Christian Heimes" <lists@cheimes.dewrote in message news:g30h90$dsj$1@ger.gmane.org... || 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...
1
by: parez | last post by:
HI, Whats the best way of handling a DPI which is different from development machine? In my current case resolution is not an issue as all machines have the same resoluation.. Should i get...
2
by: Kemmylinns12 | last post by:
Blockchain technology has emerged as a transformative force in the business world, offering unprecedented opportunities for innovation and efficiency. While initially associated with cryptocurrencies...
0
by: Naresh1 | last post by:
What is WebLogic Admin Training? WebLogic Admin Training is a specialized program designed to equip individuals with the skills and knowledge required to effectively administer and manage Oracle...
0
by: antdb | last post by:
Ⅰ. Advantage of AntDB: hyper-convergence + streaming processing engine In the overall architecture, a new "hyper-convergence" concept was proposed, which integrated multiple engines and...
1
by: Matthew3360 | last post by:
Hi there. I have been struggling to find out how to use a variable as my location in my header redirect function. Here is my code. header("Location:".$urlback); Is this the right layout the...
0
by: Arjunsri | last post by:
I have a Redshift database that I need to use as an import data source. I have configured the DSN connection using the server, port, database, and credentials and received a successful connection...
0
hi
by: WisdomUfot | last post by:
It's an interesting question you've got about how Gmail hides the HTTP referrer when a link in an email is clicked. While I don't have the specific technical details, Gmail likely implements measures...
1
by: Matthew3360 | last post by:
Hi, I have been trying to connect to a local host using php curl. But I am finding it hard to do this. I am doing the curl get request from my web server and have made sure to enable curl. I get a...
0
Oralloy
by: Oralloy | last post by:
Hello Folks, I am trying to hook up a CPU which I designed using SystemC to I/O pins on an FPGA. My problem (spelled failure) is with the synthesis of my design into a bitstream, not the C++...
0
by: Ricardo de Mila | last post by:
Dear people, good afternoon... I have a form in msAccess with lots of controls and a specific routine must be triggered if the mouse_down event happens in any control. Than I need to discover what...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.