[Numpy-discussion] byteswap() not doing anything !?

Sebastian Haase haase at msg.ucsf.edu
Wed Feb 19 12:21:38 EST 2003


>>> xx = na.array((1,2,3))
>>> xx
array([1, 2, 3])
>>> xx.byteswap()
>>> xx
array([1, 2, 3])
>>> xx.type()
Int32

Hi all,
I was reading the documentation for array 0.4
but I get the about results.
How do I get the bytes swaped like it says in the manual:

numbyteswap()
   The byteswap method performs a byte swapping 
   operation on all the elements in the array, 
   working inplace (i.e. it returns None). 
   >>> print a
   [1 2 3]
   >>> a.byteswap()
   >>> print a
   [16777216 33554432 50331648]


Thanks,
Sebastian





More information about the NumPy-Discussion mailing list