NumPy Byte Swapping - NumPy

What is Byte Swapping in NumPy?

Based on the architecture used by the CPU, the data stored is dependent. The architecture may be either big-ending (most significant byte in smallest address) or little-ending (least significant byte in the smallest address)

numpy.ndarray.byteswap()

This function toggles between the two varieties – big-endian and little-endian.

Example

The output appears as:

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

NumPy Topics