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
>>> dt = np.dtype('i4') # 32-bit signed integer >>> dt = np.dtype('f8') # 64-bit floating-point number >>> dt = np.dtype('c16') # 128-bit complex floating-point number >>> dt = np.dtype('S25') # 25-length zero-terminated bytes >>> dt = np.dtype('U25') # 25-character string
🌐
Python Data Science Handbook
jakevdp.github.io › PythonDataScienceHandbook › 02.09-structured-data-numpy.html
Structured Data: NumPy's Structured Arrays | Python Data Science Handbook
# Use a compound data type for ... of maximum length 10," 'i4' translates to "4-byte (i.e., 32 bit) integer," and 'f8' translates to "8-byte (i.e., 64 bit) float."...
🌐
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('i4') # 32-bit signed integer >>> dt = np.dtype('f8') # 64-bit floating-point number >>> dt = np.dtype('c16') # 128-bit complex floating-point number >>> dt = np.dtype('a25') # 25-character string
🌐
NumPy
numpy.org › doc › stable › › reference › generated › numpy.dtype.html
numpy.dtype — NumPy v2.4 Manual
>>> np.dtype([('a','f8'),('b','S10')]) dtype([('a', '<f8'), ('b', 'S10')]) Using comma-separated field formats. The shape is (2,3): >>> np.dtype("i4, (2,3)f8") dtype([('f0', '<i4'), ('f1', '<f8', (2, 3))]) Using tuples. int is a fixed type, 3 the field’s shape.
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.dtype.html
numpy.dtype — NumPy v2.1 Manual
>>> np.dtype([('a','f8'),('b','S10')]) dtype([('a', '<f8'), ('b', 'S10')]) Using comma-separated field formats. The shape is (2,3): >>> np.dtype("i4, (2,3)f8") dtype([('f0', '<i4'), ('f1', '<f8', (2, 3))]) Using tuples. int is a fixed type, 3 the field’s shape.
🌐
NumPy
numpy.org › doc › 2.1 › reference › arrays.dtypes.html
Data type objects (dtype) — NumPy v2.1 Manual
>>> dt = np.dtype('i4') # 32-bit signed integer >>> dt = np.dtype('f8') # 64-bit floating-point number >>> dt = np.dtype('c16') # 128-bit complex floating-point number >>> dt = np.dtype('S25') # 25-length zero-terminated bytes >>> dt = np.dtype('U25') # 25-character string
🌐
GitHub
github.com › numpy › numpy › issues › 2207
Different behaviour in ndarray.astype() for scalars and arrays (Trac #1611) · Issue #2207 · numpy/numpy
October 19, 2012 - np.array(42, dtype=">f8").astype('>f8').dtype dtype('float64') np.array([42], dtype=">f8").astype('>f8').dtype dtype('>f8')
Author   numpy-gitbot
🌐
GeeksforGeeks
geeksforgeeks.org › data-type-object-dtype-numpy-python
Data type Object (dtype) in NumPy Python - GeeksforGeeks
August 11, 2021 - # Python program for demonstrating # the use of fields import numpy as np # A structured data type containing a 16-character string (in field ‘name’) # and a sub-array of two 64-bit floating-point number (in field ‘grades’): dt = np.dtype([('name', np.unicode_, 16), ('grades', np.float64, (2,))]) # Data type of object with field grades print(dt['grades']) # Data type of object with field name print(dt['name']) Output: ('<f8', (2,)) Python ·
Find elsewhere
🌐
GitHub
github.com › pyvista › pyvista › issues › 540
'>f8' dtype arrays not properly converted by VTK · Issue #540 · pyvista/pyvista
January 15, 2020 - When trying to, e.g., scatter plot an array of points with the '>f8' dtype, the bounding box is set to garbage during construction, resulting in a blank plot. points = np.random.randn(100, 3).astype('>f8') poly = pv.PolyData(points) poly...
Author   sampotter
🌐
JAX Documentation
docs.jax.dev › en › latest › _autosummary › jax.numpy.dtype.html
jax.numpy.dtype — JAX documentation
>>> np.dtype([('a','f8'),('b','S10')]) dtype([('a', '<f8'), ('b', 'S10')]) Using comma-separated field formats. The shape is (2,3): >>> np.dtype("i4, (2,3)f8") dtype([('f0', '<i4'), ('f1', '<f8', (2, 3))]) Using tuples. int is a fixed type, 3 the field’s shape.
🌐
GitHub
github.com › ml-explore › mlx › issues › 1670
Missing f8 dtypes · Issue #1670 · ml-explore/mlx
December 7, 2024 - However, inspecting the data types list, the smallest float dtype I saw in mlx today was 16 bits (f16 or bf16) Adding 8 bit floats to mlx would effectively double the maximum possible model size. Would this be possible with software or does it need to be a hardware update? If it is possible with software, how could we make it happen? Some options for sensible default f8 e/m split for an 8-bit dtype could be:
Author   bionicles
🌐
Python Course
python-course.eu › numerical-programming › numpy-data-objects-dtype.php
3. Numpy Data Objects, dtype | Numerical Programming
import numpy as np # Native byte order (depends on system) native = np.dtype('f8') # Explicit little-endian little_endian = np.dtype('<f8') # Explicit big-endian big_endian = np.dtype('>f8') print("Native byte order dtype:", native) print("Little-endian dtype: ", little_endian) print("Big-endian dtype: ", big_endian)
🌐
University of Texas at Austin
het.as.utexas.edu › HET › Software › Numpy › reference › generated › numpy.dtype.html
numpy.dtype — NumPy v1.9 Manual
>>> np.dtype([('a','f8'),('b','S10')]) dtype([('a', '<f8'), ('b', '|S10')]) Using comma-separated field formats. The shape is (2,3): >>> np.dtype("i4, (2,3)f8") dtype([('f0', '<i4'), ('f1', '<f8', (2, 3))]) Using tuples. int is a fixed type, 3 the field’s shape.
🌐
SciPy
docs.scipy.org › doc › numpy-1.12.0 › reference › generated › numpy.dtype.html
numpy.dtype — NumPy v1.12 Manual
January 16, 2017 - >>> np.dtype([('a','f8'),('b','S10')]) dtype([('a', '<f8'), ('b', '|S10')]) Using comma-separated field formats. The shape is (2,3): >>> np.dtype("i4, (2,3)f8") dtype([('f0', '<i4'), ('f1', '<f8', (2, 3))]) Using tuples. int is a fixed type, 3 the field’s shape.
🌐
SciPy
docs.scipy.org › doc › numpy-1.16.1 › reference › generated › numpy.dtype.html
numpy.dtype — NumPy v1.16 Manual
January 31, 2019 - >>> np.dtype([('a','f8'),('b','S10')]) dtype([('a', '<f8'), ('b', '|S10')]) Using comma-separated field formats. The shape is (2,3): >>> np.dtype("i4, (2,3)f8") dtype([('f0', '<i4'), ('f1', '<f8', (2, 3))]) Using tuples. int is a fixed type, 3 the field’s shape.
🌐
SciPy
docs.scipy.org › doc › numpy-1.6.0 › reference › generated › numpy.dtype.html
numpy.dtype — NumPy v1.6 Manual (DRAFT)
May 15, 2011 - >>> np.dtype([('a','f8'),('b','S10')]) dtype([('a', '<f8'), ('b', '|S10')]) Using comma-separated field formats. The shape is (2,3): >>> np.dtype("i4, (2,3)f8") dtype([('f0', '<i4'), ('f1', '<f8', (2, 3))]) Using tuples. int is a fixed type, 3 the field’s shape.
🌐
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.dtype.html
numpy.dtype — NumPy v2.3 Manual
>>> np.dtype([('a','f8'),('b','S10')]) dtype([('a', '<f8'), ('b', 'S10')]) Using comma-separated field formats. The shape is (2,3): >>> np.dtype("i4, (2,3)f8") dtype([('f0', '<i4'), ('f1', '<f8', (2, 3))]) Using tuples. int is a fixed type, 3 the field’s shape.
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.dtype.html
numpy.dtype — NumPy v2.5.dev0 Manual
>>> np.dtype([('a','f8'),('b','S10')]) dtype([('a', '<f8'), ('b', 'S10')]) Using comma-separated field formats. The shape is (2,3): >>> np.dtype("i4, (2,3)f8") dtype([('f0', '<i4'), ('f1', '<f8', (2, 3))]) Using tuples. int is a fixed type, 3 the field’s shape.
🌐
Note.nkmk.me
note.nkmk.me › home › python › numpy
NumPy: astype() to change dtype of an array | note.nkmk.me
February 4, 2024 - The usage is the same as np.iinfo(). The arguments can be a type object (e.g., np.float64), a string ('float64', 'f8'), or a value (0.1). You can output an overview with print() or obtain the values of various attributes as numbers.