bundles / scipy 2.0.0.dev0+git20260907.41eeb59 / scipy / io / matlab / _byteordercodes / to_numpy_code
function
scipy.io.matlab._byteordercodes:to_numpy_code
source: build-install/usr/lib/python3.14/site-packages/scipy/io/matlab/_byteordercodes.py:25
Signature
def to_numpy_code(code)Summary
Convert various order codings to NumPy format.
Parameters
code: strThe code to convert. It is converted to lower case before parsing. Legal values are: 'little', 'big', 'l', 'b', 'le', 'be', '<', '>', 'native', '=', 'swapped', 's'.
Returns
out_code: {'<', '>'}Here '<' is the numpy dtype code for little endian, and '>' is the code for big endian.
Examples
import sys from scipy.io.matlab._byteordercodes import to_numpy_code sys_is_le = (sys.byteorder == 'little') sys_is_le to_numpy_code('big') to_numpy_code('little') nc = to_numpy_code('native') nc == '<' if sys_is_le else nc == '>' sc = to_numpy_code('swapped') sc == '>' if sys_is_le else sc == '<'✓
True
Aliases
scipy.io.matlab._byteordercodes.to_numpy_code