Numpy records pop up when numpy structured arrays are discussed. But I have not seen whether the use of np.record() is possible within a jitted function such as,
import numpy as np
import numba as nb
from numba import njit
dummyDtype = np.dtype([('x', 'f4'), ('y', 'f4')])
dummyNBtype = nb.from_dtype(dummyDtype)
@njit
def dummy(a, b):
return np.record((a, b), dtype=dummyNBtype)
Numpy structured array support in Numba is not “feature complete”.
To my knowledge there is no implementation for np.record(), yet.
If there is no direct solution, you can still create a new structured array, fill in the data from the source object and extract the record if that is what you need.