March 2003
Intermediate to advanced
656 pages
39h 30m
English
byteswapped
a.byteswapped( )Returns a new array object
b with the same type code and shape as
a. Each element of
b is copied from the corresponding element
of a, inverting the order of the bytes in
the value. This swapping transforms each value from little-endian to
big-endian or vice versa. Together with function
fromstring and method
a
.tostring, this helps
when you have binary data from one kind of machine and need them for
the other kind (for example, Intel platforms are little-endian, while
Sun platforms are big-endian).