numpy 1.22.4 Pypi GitHub Homepage
Other Docs
BackRef

To remove in the future –– numpy.core.records

Record Arrays

Record arrays expose the fields of structured arrays as properties.

Most commonly, ndarrays contain elements of a single type, e.g. floats, integers, bools etc. However, it is possible for elements to be combinations of these using structured types, such as:

>>> a = np.array([(1, 2.0), (1, 2.0)], dtype=[('x', np.int64), ('y', np.float64)])
>>> a
array([(1, 2.), (1, 2.)], dtype=[('x', '<i8'), ('y', '<f8')])

Here, each element consists of two fields: x (and int), and y (a float). This is known as a structured array. The different fields are analogous to columns in a spread-sheet. The different fields can be accessed as one would a dictionary:

>>> a['x']
array([1, 1])

>>> a['y']
array([2., 2.])

Record arrays allow us to access fields as properties:

>>> ar = np.rec.array(a)

>>> ar.x
array([1, 1])

>>> ar.y
array([2., 2.])

Examples

See :

Back References

The following pages refer to to this document either explicitly or contain code examples using this.

numpy.typing

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/core/records.py#0
type: <class 'module'>
Commit: