Hi all -

I have read some big-endian data and I want to byte swap it to little
endian.  If I use
  a.byteswap(True)
the bytes clearly get swapped, but the dtype is not updated to reflect
the new data type.  e.g

[~]|1> a=N.array([2.5, 3.2])
[~]|2> a.dtype.descr
   <2> [('', '<f8')]
[~]|3> a.byteswap(True)
   <3> array([  5.37543423e-321,  -1.54234871e-180])
[~]|4> a.dtype.descr
   <4> [('', '<f8')]

I expected the dtype to be changed so that the print of the array
would look the same as before, and mathematical operations would work
properly. This can be done with:
  a.dtype = a.dtype.newbyteorder()
Should this not be performed by byteswap()?

Erin
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://projects.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to