From: Norman S. <Nor...@mo...> - 2003-10-07 15:58:54
|
How do I take data from a double array or a complex array as defined below and initialize a Numeric array and load it appropriately? struct complex { double real; double imag; } complex; complex cdata[100]; double *data[100]; PyArrayObject *array; /* code where cdata and data are loaded up is not included *. I think this is how I do it for doubles (correct me if I'm wrong). array = PyArray_FromDims(1, numData, PyArray_DOUBLE) for (i=0; i< 100; i++) { (double *)(array->data)[i] = data[i]; } How do I load the data in cdata into an PyArrayObject? Thanks, Norman Shelley |