Tom Denniston wrote:

>Code that reproduces the problem:
>
>This is regular python:
>pickle.dumps(numpy.nan, 2)
>SystemError: frexp() result out of range
>
>This is fine in numpy:
>pickle.dumps(numpy.array([numpy.nan]), 2)
>
>This breaks:
>pickle.dumps(numpy.array([numpy.nan], numpy.PyObject), 2)
>SystemError: frexp() result out of range
>  
>
It seems to me that the example that shows what you want is the only
example that numpy has control over, anyway. In the other two cases,
you're really using a Python object.

So it's really a Python question as to why it can't pickle nans. My
understanding on this is weak, but here's one summary, albeit dated:
http://www.python.org/dev/summary/2000-10-1.html Here's something more
recent: http://mail.python.org/pipermail/python-list/2005-July/290272.html

NumPy sidesteps these issues by "forcing" IEEE-754 behavior with clever
C written AFAIK by the numarray people. These apparently work even if
the C compiler doesn't "officially" support IEEE-754, but it's not going
to work on every platform that Python targets.

You may also want to take a look at
http://scipy.org/FAQ#head-fff4d6fce7528974185715153cfbc1a191dcb915

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion

Reply via email to