On Sun, Jan 25, 2009 at 4:35 AM, Matthew Brett wrote:
> Hi,
>
> When converting arrays from float to ints, I notice that NaNs, Infs,
> and -Infs all get the minimum integer value:
>
flts = np.array([np.nan, np.inf, -np.inf])
flts.astype(np.int16)
> array([-32768, -32768, -32768], dtype=i
2009/1/25 Matthew Brett :
> When converting arrays from float to ints, I notice that NaNs, Infs,
> and -Infs all get the minimum integer value:
>
flts = np.array([np.nan, np.inf, -np.inf])
flts.astype(np.int16)
> array([-32768, -32768, -32768], dtype=int16)
>
> However, setting NaNs into
Hi,
When converting arrays from float to ints, I notice that NaNs, Infs,
and -Infs all get the minimum integer value:
>>> flts = np.array([np.nan, np.inf, -np.inf])
>>> flts.astype(np.int16)
array([-32768, -32768, -32768], dtype=int16)
However, setting NaNs into integer arrays gives a value of 0