Re: [Numpy-discussion] Recarray comparison and byte order

2009-10-31 Thread Matthew Brett
Hi, >> c = a.byteswap().newbyteorder() >> c == a > > In the last two lines, a variable "c" is assigned to a modified "a".  The > next line tests (==) to see if "c" is the same as (==) the unmodified "a". > It isn't, because "c" is the modified "a".  Hence, "False". Sorry, I wasn't very clear - th

Re: [Numpy-discussion] Recarray comparison and byte order

2009-10-31 Thread Ian Mallett
On Sat, Oct 31, 2009 at 9:38 AM, Matthew Brett wrote: > c = a.byteswap().newbyteorder() > c == a > In the last two lines, a variable "c" is assigned to a modified "a". The next line tests (==) to see if "c" is the same as (==) the unmodified "a". It isn't, because "c" is the modified "a". Hence,

[Numpy-discussion] Recarray comparison and byte order

2009-10-31 Thread Matthew Brett
Hi, I was surprised by this - is it a bug or a feature or me misunderstanding something? a = np.zeros((1,), dtype=[('f1', 'u2')]) b = a.copy() b == a (array([True], dtype=bool)) # as expected c = a.byteswap().newbyteorder() c == a (False) # to me, unexpected, note bool rather than array Thanks f