[Numpy-discussion] byteorder question (original) (raw)

Jonathan Taylor jonathan.taylor at stanford.edu
Fri Jun 30 18:46:04 EDT 2006


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 "", line 1, in ? TypeError: descriptor 'newbyteorder' requires a 'genericscalar' object but received a 'str' swapped=d.newbyteorder('>') Traceback (most recent call last): File "", 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

-------------- next part -------------- A non-text attachment was scrubbed... Name: jonathan.taylor.vcf Type: text/x-vcard Size: 329 bytes Desc: not available URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20060630/3eba3b8e/attachment.vcf>



More information about the NumPy-Discussion mailing list