numpy.record.newbyteorder

method

record.newbyteorder(new_order='S', /)

Return a new dtype with a different byte order.

Changes are also made in all fields and sub-arrays of the data type.

The new_order code can be any from the following:

  • ‘S’ - swap dtype from current to opposite endian
  • {‘<’, ‘little’} - little endian
  • {‘>’, ‘big’} - big endian
  • ‘=’ - native order
  • {‘|’, ‘I’} - ignore (no change to byte order)
Parameters
new_orderstr, optional

Byte order to force; a value from the byte order specifications above. The default value (‘S’) results in swapping the current byte order.

Returns
new_dtypedtype

New dtype object with the given change to the byte order.

© 2005–2021 NumPy Developers
Licensed under the 3-clause BSD License.
https://numpy.org/doc/1.21/reference/generated/numpy.record.newbyteorder.html