bundles / numpy latest / numpy / lib / _iotools / flatten_dtype
function
numpy.lib._iotools:flatten_dtype
source: build-install/usr/lib/python3.14/site-packages/numpy/lib/_iotools.py :85
Signature
def flatten_dtype ( ndtype , flatten_base = False ) Summary
Unpack a structured data-type by collapsing nested fields and/or fields with a shape.
Extended Summary
Note that the field names are lost.
Parameters
ndtype: dtypeThe datatype to collapse
flatten_base: bool, optionalIf True, transform a field with a shape into several fields. Default is False.
Examples
import numpy as np dt = np.dtype([('name', 'S4'), ('x', float), ('y', float), ('block', int, (2, 3))]) np.lib._iotools.flatten_dtype(dt)✓
np.lib._iotools.flatten_dtype(dt, flatten_base=True)
✗Aliases
-
numpy.lib._iotools.flatten_dtype