I\'m trying to understand how the Python C- Api works, and I want to exchange numpy arrays between Python and a C Extension.
So, I started this tutorial: http://dsnr
Your init function for the module needs to call
import_array();
after
(void) Py_InitModule("trace", TraceMethods);
It mentions this in the tutorial near the top, but it is easy to miss. Without this, it segfaults on PyArray_ContiguousFromObject.
PyArray_ContiguousFromObject