In article <[EMAIL PROTECTED]>, Francesc Altet <[EMAIL PROTECTED]> wrote:
> El dj 26 de 04 del 2007 a les 11:38 -0700, en/na Russell E. Owen va > escriure: > > In converting some code from numarray to numpy I had this: > > isBigendian = (arr.isbyteswapped() != numarray.isBigEndian) > > > > The only numpy version I've come up with is: > > isBigEndian = (arr.dtype.descr[0][1][0] == '>') > > isBigEndian = (arr.dtype.str[0] == '>') > > is a little bit shorter. A more elegant approach could be: > > isBigEndian = arr.dtype.isnative ^ numpy.little_endian Thank you. That's just what I wanted (I had looked for the numpy version of numarray.isBigEndian but somehow missed it). Your other suggestion is also much nicer than my version, but I'll use the latter. -- Russell _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://projects.scipy.org/mailman/listinfo/numpy-discussion