[Numpy-discussion] Re: byteswap questions

Rick White rlw at stsci.edu
Thu Nov 3 06:01:59 CST 2005


On Wed, 2 Nov 2005, Russell E. Owen wrote:

> To use documented interfaces (i.e. not arra._byteorder) and to avoid
> byteswapping the input array, I think I'm going to be stuck doing
> something like:
>
> import sys
> if sys.byteorder == 'big':
>    isBigendian = not arr.isbyteswapped()
> else:
>    isBigendian = arr.isbyteswapped()

A simpler version:

isBigendian = arr.isbyteswapped() != numarray.isBigEndian




More information about the Numpy-discussion mailing list