bundles / numpy 2.4.4 / numpy / rec / fromrecords
function
numpy.rec:fromrecords
source: /numpy/_core/records.py :663
Signature
def fromrecords ( recList , dtype = None , shape = None , formats = None , names = None , titles = None , aligned = False , byteorder = None ) Summary
Create a recarray from a list of records in text form.
Parameters
recList: sequencedata in the same field may be heterogeneous - they will be promoted to the highest data type.
dtype: data-type, optionalvalid dtype for all arrays
shape: int or tuple of ints, optionalshape of each array.
formats, names, titles, aligned, byteorderIf
dtypeisNone, these arguments are passed tonumpy.format_parserto construct a dtype. See that function for detailed documentation.If both
formatsanddtypeare None, then this will auto-detect formats. Use list of tuples rather than list of lists for faster processing.
Returns
: np.recarrayrecord array consisting of given recList rows.
Examples
r=np.rec.fromrecords([(456,'dbe',1.2),(2,'de',1.3)], names='col1,col2,col3') print(r[0]) r.col1 r.col2 import pickle pickle.loads(pickle.dumps(r))✓
Aliases
-
numpy.rec.fromrecords