numpy.chararray.newbyteorderΒΆ
-
chararray.
newbyteorder
(new_order='S')ΒΆ Return the array with the same data viewed with a different byte order.
Equivalent to:
arr.view(arr.dtype.newbytorder(new_order))
Changes are also made in all fields and sub-arrays of the array data type.
Parameters: - new_order : string, optional
Byte order to force; a value from the byte order specifications below. new_order codes can be any of:
- βSβ - swap dtype from current to opposite endian
- {β<β, βLβ} - little endian
- {β>β, βBβ} - big endian
- {β=β, βNβ} - native order
- {β|β, βIβ} - ignore (no change to byte order)
The default value (βSβ) results in swapping the current byte order. The code does a case-insensitive check on the first letter of new_order for the alternatives above. For example, any of βBβ or βbβ or βbiggishβ are valid to specify big-endian.
Returns: - new_arr : array
New array object with the dtype reflecting given change to the byte order.