[Numpy-discussion] Numarrays from C arrays without copying

Ville Hakulinen ville at e.math.helsinki.fi
Thu Apr 22 05:56:17 EDT 2004

Dear all,

I would like to turn a large C array allocated by a library into a
Numarray object without copying the contents. In other words I have
a given array of double precision floats and I want to get a Numarray
object, where the data pointer points to this array and no additional
memory is allocated. Naturally when the reference count of the Numarray
object gets back to zero, the object is freed, but the array itself
is left as a nuisance for the C code.

Is there a standard way of doing this?

Thanks in advance,

More information about the NumPy-Discussion mailing list