[Numpy-discussion] trivial question: how to compare dtype - but ignoring byteorder ?

Travis Oliphant oliphant.travis at ieee.org
Mon Jul 24 14:31:06 CDT 2006

Sebastian Haase wrote:
> Hi,
> if I have a numpy array 'a'
> and say:
> a.dtype == numpy.float32
> Is the result independent of a's byteorder ?
The byteorder is a property of the data-type (not of the array) --- this 
is different from numarray where byteorder is a property of the array.

a.dtype == numpy.float32 will always set the data-type to a 
machine-native float32 data-type.


More information about the Numpy-discussion mailing list