Using pybind11 C++ API and python3, how can we properly create a numpy array of objects (i.e. unicode strings) in the C++ implementation and return it back to python? What is the exact memory layout of the underlying data array passed into pybind11::array()? How exactly do we need to manage memory, i.e. delete/free?
Note that this is necessary because we want to use that array of strings, in conjunction with other POD arrays, in pandas DataFrame creation.
pybind11. Butnumpyarrays can be created with a function thenumpy C API. Array layouts are all basically the same, attributes plus a data buffer. For an object type the data buffer contains pointers to objects elsewhere in memory. WIth aunicodedtype that buffer actually contains the strings (padded to a specified length). You may have to study thenumpydocs.