[Numpy-discussion] byteorder question

Jonathan Taylor jonathan.taylor at stanford.edu
Sun Jul 2 15:38:28 CDT 2006


Thanks. The byteswap works for me now, but I have another problem...

--------------------------------------------------------------------
 >>> import numpy as N
 >>> d = N.dtype(N.float64)
 >>> d.newbyteorder('big')
dtype('>f8')
 >>> D = d.newbyteorder('big')
 >>>
 >>> x = N.zeros((10,10), D)
 >>> N.nan_to_num(x)
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File 
"/home/jtaylo/python/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
 >>>
 >>>
------------------------------------------------------------


Here is what maxf, minf are:

----------------------------------------------------------------

SystemError: error return without exception set
/home/jtaylo/python/lib/python2.4/site-packages/numpy/lib/type_check.py 
in nan_to_num()
    126         y[are_nan] = 0
--> 127         y[are_inf] = maxf
    128         y[are_neg_inf] = minf

ipdb> maxf
array(1.7976931348623157e+308)
ipdb> minf
-1.7976931348623157e+308

-----------------------------------------------------------------------
-----------------------------------------------------------

-- Jonathan



-- 

------------------------------------------------------------------------
Jonathan Taylor                           Tel:   650.723.9230
Dept. of Statistics                       Fax:   650.725.8977
Sequoia Hall, 137                         www-stat.stanford.edu/~jtaylo
390 Serra Mall
Stanford, CA 94305





More information about the Numpy-discussion mailing list