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

Travis Oliphant oliphant.travis at ieee.org
Mon Jul 24 15:31:06 EDT 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.

-Travis





More information about the NumPy-Discussion mailing list