[Numpy-discussion] nan_to_num() SystemException
Tim Leslie
tim.leslie at gmail.com
Sun Jul 2 06:53:58 EDT 2006
Hi All,
The following script:
import numpy as N
print N.__version__
a = N.array([1,2,3,4], dtype=N.float64)
a.dtype = a.dtype.newbyteorder('big')
print N.nan_to_num(a)
gives the following exception:
0.9.9.2707
Traceback (most recent call last):
File "memmap_nan.py", line 5, in ?
print N.nan_to_num(a)
File "/usr/lib/python2.4/site-packages/numpy/lib/type_check.py",
line 127, in nan_to_num
y[are_inf] = maxf
SystemError: error return without exception set
Could someone shed some light on this? I'm at a bit of a loss as where
to go. I had a poke around inside type_check.py but didn't get very
far. I confirmed that are_inf in type_check.py is [False, False,
False, False], as expected. I changed the value of maxf to different
values (0, maxf+1, maxf-1, maxf+0.00000001, minf, 37), and with any of
these different values the SystemError goes away. Beyond that, I'm not
sure how to chase this one down.
Cheers,
Tim Leslie
More information about the NumPy-Discussion
mailing list