From: Jonathan T. <jon...@st...> - 2006-06-30 22:46:01
|
In some earlier code (at least one of) the following worked fine. I just want to get a new type that is a byteswap of, say, float64 because I want to memmap an array with a non-native byte order. Any suggestions? Thanks, Jonathan ------------------------------------------ Python 2.4.3 (#2, Apr 27 2006, 14:43:58) [GCC 4.0.3 (Ubuntu 4.0.3-1ubuntu5)] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import numpy >>> numpy.__version__ '0.9.9.2716' >>> d=numpy.float64 >>> swapped=d.newbyteorder('big') Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: descriptor 'newbyteorder' requires a 'genericscalar' object but received a 'str' >>> swapped=d.newbyteorder('>') Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: descriptor 'newbyteorder' requires a 'genericscalar' object but received a 'str' >>> -- ------------------------------------------------------------------------ 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 |