def convert(self, other):
"""Convert a :class:`numpy.recarray` to a :class:`numpy.recarray` with additional fields, filling the additional fields with 0.
:param other: The :class:`numpy.recarray` to be converted.
:type other: :class:`numpy.recarray`"""
a = self(np.zeros(self._nfields))
if npv < (1,13,0):
a[other.dtype.names] = other
elif npv < (1,14,0):
with warnings.catch_warnings():
warnings.simplefilter('ignore', FutureWarning)
a[:] = other
else:
for field_name in self._fields:
a[field_name] = other[field_name]
return a
评论列表
文章目录