MCPcopy Index your code
hub / github.com/numpy/numpy / rec_append_fields

Function rec_append_fields

numpy/lib/recfunctions.py:731–762  ·  view source on GitHub ↗

Add new fields to an existing array. The names of the fields are given with the `names` arguments, the corresponding values with the `data` arguments. If a single field is appended, `names`, `data` and `dtypes` do not have to be lists but just values. Parameters ------

(base, names, data, dtypes=None)

Source from the content-addressed store, hash-verified

729
730@array_function_dispatch(_rec_append_fields_dispatcher)
731def rec_append_fields(base, names, data, dtypes=None):
732 """
733 Add new fields to an existing array.
734
735 The names of the fields are given with the `names` arguments,
736 the corresponding values with the `data` arguments.
737 If a single field is appended, `names`, `data` and `dtypes` do not have
738 to be lists but just values.
739
740 Parameters
741 ----------
742 base : array
743 Input array to extend.
744 names : string, sequence
745 String or sequence of strings corresponding to the names
746 of the new fields.
747 data : array or sequence of arrays
748 Array or sequence of arrays storing the fields to add to the base.
749 dtypes : sequence of datatypes, optional
750 Datatype or sequence of datatypes.
751 If None, the datatypes are estimated from the `data`.
752
753 See Also
754 --------
755 append_fields
756
757 Returns
758 -------
759 appended_array : np.recarray
760 """
761 return append_fields(base, names, data=data, dtypes=dtypes,
762 asrecarray=True, usemask=False)
763
764
765def _repack_fields_dispatcher(a, align=None, recurse=None):

Callers

nothing calls this directly

Calls 1

append_fieldsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…