1

I have a library in C++ which I import in Python language. This library has a method that returns a float32 2D matrix (pointer), but I previously used a numpy array to represent this matrix. Now that I have this matrix made in C++ I can't use the methods of numpy library correctly. So is there any way of importing this matrix allocated in C++ to a numpy object?

Thanks in advance.

Charles
  • 50,943
  • 13
  • 104
  • 142
  • It sounds like your question was already answered here, in a more general sense. You need to use `numpy.frombuffer` to create the array from the C++ pointer. http://stackoverflow.com/questions/4355524/getting-data-from-ctypes-array-into-numpy – codewarrior Feb 06 '13 at 19:00

0 Answers0