Endian-ness.

< = little-endian (LSB first)

> = big-endian (MSB first)

https://docs.scipy.org/doc/numpy/reference/generated/numpy.dtype.byteorder.html

Answer from Jason S on Stack Overflow
🌐
NumPy
numpy.org › doc › stable › reference › arrays.dtypes.html
Data type objects (dtype) — NumPy v2.4 Manual
>>> import numpy as np >>> dt = np.dtype("i4, (2,3)f8, f4") field named f0 containing a 3-character string · field named f1 containing a sub-array of shape (3,) containing 64-bit unsigned integers · field named f2 containing a 3 x 4 sub-array containing 10-character strings ·
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-data-type-objects
NumPy - Data type Objects(dtype) - GeeksforGeeks
July 23, 2025 - import numpy as np # Custom structured data type x = np.dtype([('name', 'U10'), ('age', 'i4'), ('weight', 'f4')]) a = np.array([('Alice', 25, 55.5), ('Bob', 30, 72.3)], dtype=x) print(a) print(a.dtype) Output · [('Alice', 25, 55.5) ('Bob', 30, 72.3)] [('name', '<U10'), ('age', '<i4'), ('weight', '<f4')] Byte Order : The byte order can be specified using prefixes: < for little-endian.
🌐
GitHub
github.com › numpy › numpy › issues › 13444
numpy.concatenate change '>f4' dtype to 'float32' · Issue #13444 · numpy/numpy
April 30, 2019 - I've encountered some strange behavior of numpy.concatenate today. So I have two arrays of data type '>f4', but after concatenate, the combined array type changed to 'float32'. This is confusion and I thought all numpy function keep the ...
Author   wang1943
🌐
Python for Data Science
python4data.science › en › latest › workspace › numpy › dtype.html
dtype - Python for Data Science
ndarray is a container for homogeneous data, i.e. all elements must be of the same type. Each array has a dtype, an object that describes the data type of the array: NumPy data types:,,, Type, Type...
🌐
SciPy
docs.scipy.org › doc › numpy-1.4.x › reference › arrays.dtypes.html
Data type objects (dtype) - Numpy and Scipy Documentation
July 21, 2010 - >>> dt = np.dtype((np.int32, (2,2))) # 2 x 2 integer sub-array >>> dt = np.dtype(('S10', 1)) # 10-character string >>> dt = np.dtype(('i4, (2,3)f8, f4', (2,3))) # 2 x 3 record sub-array · (base_dtype, new_dtype) Both arguments must be convertible to data-type objects in this case.
🌐
Ufkapano
ufkapano.github.io › scicomppy › week08 › np_dtype.html
NumPy - data type objects
# Using array-scalar types. dt_int ... # "H", "u2", 'uint16'; # "u4", "uint32"; # "u8", "uint64"; dt_float = np.dtype(float) # Python-compatible floating-point number # "f2", 'float16'; # "f", "f4", 'float32' ('float' in 32-bit); # "d", "f8", 'float64' ('double', 'float' in ...
🌐
NumPy
numpy.org › doc › 2.1 › reference › arrays.dtypes.html
Data type objects (dtype) — NumPy v2.1 Manual
>>> import numpy as np >>> dt = np.dtype("i4, (2,3)f8, f4") field named f0 containing a 3-character string · field named f1 containing a sub-array of shape (3,) containing 64-bit unsigned integers · field named f2 containing a 3 x 4 sub-array containing 10-character strings ·
🌐
Cryosparc
tools.cryosparc.com › api › dtype.html
cryosparc.dtype — cryosparc-tools
Can just be a single string such as “f4”, “3u4” or “O”. A datatype description of a ndarray entry. Can also be the a tuple with a string datatype name and its shape. For example, the following dtypes are equivalent.
Find elsewhere
🌐
GitHub
github.com › tensorflow › tensorflow › issues › 13384
Tensorflow - Error: Cannot convert value dtype('<f4') to a TensorFlow DType · Issue #13384 · tensorflow/tensorflow
September 29, 2017 - File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/dtypes.py", line 584, in as_dtype "Cannot convert value %r to a TensorFlow DType." % type_value) TypeError: Cannot convert value dtype('<f4') to a TensorFlow DType.
Author   claudefalbriard
🌐
SciPy
docs.scipy.org › doc › numpy-1.14.0 › user › basics.rec.html
Structured arrays — NumPy v1.14 Manual
>>> d = np.dtype([('x', 'i8'), ('y', 'f4')]) >>> d.names ('x', 'y') The field names may be modified by assigning to the names attribute using a sequence of strings of the same length. The dtype object also has a dictionary-like attribute, fields, whose keys are the field names (and Field Titles, see below) and whose values are tuples containing the dtype and byte offset of each field.
🌐
TutorialsPoint
tutorialspoint.com › numpy › numpy_data_types.htm
NumPy - Data Types
import numpy as np student = np.dtype([('name', 'S20'), ('age', 'i1'), ('marks', 'f4')]) print(student) We get the output as shown below − ·
🌐
GeeksforGeeks
geeksforgeeks.org › data-type-object-dtype-numpy-python
Data type Object (dtype) in NumPy Python - GeeksforGeeks
August 11, 2021 - # dt is a dtype object dt = np.dtype('>i4') print("Byte order is:",dt.byteorder) print("Size is:",dt.itemsize) print("Data type is:",dt.name) ... b1, i1, i2, i4, i8, u1, u2, u4, u8, f2, f4, f8, c8, c16, a (representing bytes, ints, unsigned ints, floats, complex and fixed-length strings of specified byte lengths)
🌐
NumPy
numpy.org › devdocs › reference › arrays.dtypes.html
Data type objects (dtype) — NumPy v2.5.dev0 Manual
>>> dt = np.dtype((np.int32, (2,2))) # 2 x 2 integer sub-array >>> dt = np.dtype(('i4, (2,3)f8, f4', (2,3))) # 2 x 3 structured sub-array
🌐
Note.nkmk.me
note.nkmk.me › home › python › numpy
NumPy: astype() to change dtype of an array | note.nkmk.me
February 4, 2024 - NumPy arrays (ndarray) hold a data type (dtype). You can set this through various operations, such as when creating an ndarray with np.array(), or change it later with astype(). Data type objects (dty ...
🌐
GitHub
github.com › numpy › numpy › issues › 17173
Regression in array creation `np.array([...], dtype='(2,2)f4')` RuntimeError (Zarr testsuite ) · Issue #17173 · numpy/numpy
August 27, 2020 - In [1]: import numpy as np ...: a = np.array([((0, 1), ...: (1, 2)), ...: ((1, 2), ...: (2, 3)), ...: ((2, 3), ...: (3, 4))], dtype='(2,2)f4') --------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) <ipython-input-1-0a6ed20baa50> in <module> 5 (2, 3)), 6 ((2, 3), ----> 7 (3, 4))], dtype='(2,2)f4') RuntimeError: Inconsistent object during array creation?
Author   Carreau
🌐
Python Data Science Handbook
jakevdp.github.io › PythonDataScienceHandbook › 02.09-structured-data-numpy.html
Structured Data: NumPy's Structured Arrays | Python Data Science Handbook
dtype([('name', '<U10'), ('age', '<i8'), ('weight', '<f4')]) A compound type can also be specified as a list of tuples: In [12]: np.dtype([('name', 'S10'), ('age', 'i4'), ('weight', 'f8')]) Out[12]: dtype([('name', 'S10'), ('age', '<i4'), ('weight', '<f8')]) If the names of the types do not matter to you, you can specify the types alone in a comma-separated string: In [13]: np.dtype('S10,i4,f8') Out[13]: dtype([('f0', 'S10'), ('f1', '<i4'), ('f2', '<f8')]) The shortened string format codes may seem confusing, but they are built on simple principles.
🌐
SciPy
docs.scipy.org › doc › numpy-1.10.1 › user › basics.rec.html
Structured arrays — NumPy v1.10 Manual
>>> x = np.array([(1,2.,'Hello'), (2,3.,"World")], ... dtype=[('foo', 'i4'),('bar', 'f4'), ('baz', 'S10')]) >>> x array([(1, 2.0, 'Hello'), (2, 3.0, 'World')], dtype=[('foo', '>i4'), ('bar', '>f4'), ('baz', '|S10')])
🌐
NumPy
numpy.org › doc › stable › user › basics.rec.html
Structured arrays — NumPy v2.4 Manual
>>> np.dtype([(('my title', 'name'), 'f4')]) dtype([(('my title', 'name'), '<f4')]) When using the first form of dictionary-based specification, the titles may be supplied as an extra 'titles' key as described above. When using the second (discouraged) dictionary-based specification, the title can be supplied by providing a 3-element tuple (datatype, offset, title) instead of the usual 2-element tuple: >>> np.dtype({'name': ('i4', 0, 'my title')}) dtype([(('my title', 'name'), '<i4')])
🌐
GitHub
github.com › numpy › numpy › issues › 30890
BUG: common_type(dtype('f4'), dtype('f4')) raises AttributeError unexpectedly · Issue #30890 · numpy/numpy
February 26, 2026 - >>> import numpy as np >>> np.common_type(np.dtype('f4'), np.dtype('f4')) Traceback (most recent call last): File "<python-input-1>", line 1, in <module> np.common_type(np.dtype('f4'), np.dtype('f4')) ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/opavlyk/miniforge/envs/np_new/...
Author   oleksandr-pavlyk