[Numpy-discussion] Changing byte ordering with astype fails with 0d arrays

Matthew Brett matthew.brett at gmail.com
Mon Sep 18 13:49:54 CDT 2006


Hi,

As expected:

In [67]:a = array([1], dtype='<i4')

In [68]:a.astype('>i4').dtype
Out[68]:dtype('>i4')

I was also expecting this to work for 0d arrays, but it doesn't:

In [69]:a = array(1, dtype='<i4')

In [70]:a.astype('>i4').dtype
Out[70]:dtype('<i4')

Is this as intended?

Thanks a lot,

Matthew




More information about the Numpy-discussion mailing list