Creating new NumPy array in C

Allocate a new array:
PyObject * PyArray_FromDims(int n_dimensions,
                            int dimensions[n_dimensions],
                            int type_num);

PyArrayObject *a;  int dims[2];
dims[0] = 10;  dims[1] = 21;
a = (PyArrayObject *) PyArray_FromDims(2, dims, PyArray_DOUBLE);

previousnexttable of contents