numpy 1.22.4 Pypi GitHub Homepage
Other Docs
Parameters
flatten_dtype(ndtype, flatten_base=False)

Note that the field names are lost.

Parameters

ndtype : dtype

The datatype to collapse

flatten_base : bool, optional

If True, transform a field with a shape into several fields. Default is False.

Unpack a structured data-type by collapsing nested fields and/or fields with a shape.

Examples

>>> dt = np.dtype([('name', 'S4'), ('x', float), ('y', float),
...  ('block', int, (2, 3))])
... np.lib._iotools.flatten_dtype(dt) [dtype('S4'), dtype('float64'), dtype('float64'), dtype('int64')]
>>> np.lib._iotools.flatten_dtype(dt, flatten_base=True)
[dtype('S4'),
 dtype('float64'),
 dtype('float64'),
 dtype('int64'),
 dtype('int64'),
 dtype('int64'),
 dtype('int64'),
 dtype('int64'),
 dtype('int64')]
See :

Local connectivity graph

Hover to see nodes names; edges to Self not shown, Caped at 50 nodes.

Using a canvas is more power efficient and can get hundred of nodes ; but does not allow hyperlinks; , arrows or text (beyond on hover)

SVG is more flexible but power hungry; and does not scale well to 50 + nodes.

All aboves nodes referred to, (or are referred from) current nodes; Edges from Self to other have been omitted (or all nodes would be connected to the central node "self" which is not useful). Nodes are colored by the library they belong to, and scaled with the number of references pointing them


GitHub : /numpy/lib/_iotools.py#86
type: <class 'function'>
Commit: