Read swig python 'double *' object into numpy (maybe through ctypes?)
问题 I have swig python library that I can't modify. It returns a <Swig object of type 'double *'> which I know is a pointer to an array of doubles. Through a separate function, I get a python int for the length. My question is, how can I read this data into numpy? I've found the numpy.ndarray.ctypes module, and another stackoverflow answer that hints that a conversion from SWIG to ctypes is possible (https://stackoverflow.com/a/41212424/654602) but makes no mention how. Any help is appreciated.