[Numpy-discussion] LapackError:non-native byte order

Matthew Brett matthew.brett@gmail....
Mon Nov 8 13:05:34 CST 2010


Hi,

On Mon, Nov 8, 2010 at 10:34 AM, Pauli Virtanen <pav@iki.fi> wrote:
> Mon, 08 Nov 2010 19:31:31 +0100, Pauli Virtanen wrote:
>
>> ma, 2010-11-08 kello 18:56 +0100, LittleBigBrain kirjoitti:
>>> In my system '<' is the native byte-order, but unless I change the
>>> byte-order label to '=', it won't work in linalg sub-module, but in
>>> others works OK. I am not sure whether this is an expected behavior or
>>> a bug?
>>> >>> import sys
>>> >>> sys.byteorder
>>> 'little'
>>> >>> a.dtype.byteorder
>>> '<'
>>> >>> b.dtype.byteorder
>>> '<'
>>
>> The error is here: it's not possible to create such dtypes via any Numpy
>> methods -- the '<' (or '>') is always normalized to '='. Numpy and
>> several other modules consequently assume this normalization.
>>
>> Where do `a` and `b` come from?
>
> Ok, `x.newbyteorder('<')` seems to do this. Now I'm unsure how things are
> supposed to work.

Yes - it is puzzling that ``x.newbyteorder('<')`` makes arrays that
are confusing to numpy.  If numpy generally always normalizes to the
system endian to '=' then should that not also be true of
``newbyteorder``?

See you,

Matthew


More information about the NumPy-Discussion mailing list