I am creating a C extension for numpy. The function should return an array, so I decided to create a PyArrayObject with dimensions 50x10 using PyArray_SimpleNew and later fill it with some values. Here is the code:
PyArrayObject *a; npy_intp dims[2];
dims[0] = 50; dims[1] = 10;
a = (PyArrayObject *) PyArray_SimpleNew(2, dims, NPY_DOUBLE);
However, the creation of the array a in the third line produces Segmentation Fault. Any idea what could be the problem?