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

Bradley M. Froehle brad.froehle@gmail....
Mon Jan 28 19:09:50 CST 2013


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

On Mon, Jan 28, 2013 at 3:48 PM, Geoffrey Irving <irving@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.scipy.org/pipermail/numpy-discussion/attachments/20130128/1610f502/attachment.html 


More information about the NumPy-Discussion mailing list