[Numpy-discussion] fortran array storage question
Fri Oct 26 07:30:57 CDT 2007
I found now a way to get the data:
> Therefore I do the following (2D example):
> obj = PyArray_FromDimsAndData(2, dim0, PyArray_DOUBLE, (char*)data);
> PyArrayObject *tmp = (PyArrayObject*)obj;
> tmp->flags = NPY_FARRAY;
if in that example I also change the strides:
int s = tmp->strides;
tmp->strides = s;
tmp->strides = s * dim0;
Then I get in python the fortran-style array in right order.
However, I don't know if this is the usual way or if it has a
performance overhead ...
More information about the Numpy-discussion