[Numpy-discussion] PyArray_FromAny silently converts None to a singleton nan

Bradley M. Froehle brad.froehle at gmail.com
Mon Jan 28 20:09:50 EST 2013


>>> import numpy as np
>>> np.double(None)
nan

On Mon, Jan 28, 2013 at 3:48 PM, Geoffrey Irving <irving at naml.us> wrote:

> I discovered this from C via the PyArray_FromAny function, but here it
> is in Python:
>
>     >>> asarray(None,dtype=float)
>     array(nan)
>
> Is this expected or documented behavior?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20130128/1610f502/attachment.html>


More information about the NumPy-Discussion mailing list