numpy 1.22.4 Pypi GitHub Homepage
Other Docs
ParametersReturnsBackRef
fromrecords(recList, dtype=None, shape=None, formats=None, names=None, titles=None, aligned=False, byteorder=None)

Parameters

recList : sequence

data in the same field may be heterogeneous - they will be promoted to the highest data type.

dtype : data-type, optional

valid dtype for all arrays

shape : int or tuple of ints, optional

shape of each array.

formats, names, titles, aligned, byteorder :

If dtype is None , these arguments are passed to numpy.format_parser to construct a dtype. See that function for detailed documentation.

If both :None:None:`formats` and dtype are None, then this will auto-detect formats. Use list of tuples rather than list of lists for faster processing.

Returns

np.recarray

record array consisting of given recList rows.

Create a recarray from a list of records in text form.

Examples

>>> r=np.core.records.fromrecords([(456,'dbe',1.2),(2,'de',1.3)],
... names='col1,col2,col3')
... print(r[0]) (456, 'dbe', 1.2)
>>> r.col1
array([456,   2])
>>> r.col2
array(['dbe', 'de'], dtype='<U3')
>>> import pickle
... pickle.loads(pickle.dumps(r)) rec.array([(456, 'dbe', 1.2), ( 2, 'de', 1.3)], dtype=[('col1', '<i8'), ('col2', '<U3'), ('col3', '<f8')])
See :

Back References

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

numpy.rec.array

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#683
type: <class 'function'>
Commit: