[Numpy-discussion] Numarrays from C arrays without copying
Todd Miller
jmiller at stsci.edu
Thu Apr 22 13:07:01 EDT 2004
On Thu, 2004-04-22 at 14:34, Craig Rasmussen wrote:
> On Apr 22, 2004, at 10:57 AM, Todd Miller wrote:
>
> >> This is what PyArray_FromDimsAndData was for, and I believe it is
> >> fairly
> >> heavily used.
> >
> > That's good to know. I was just discussing with Perry how to expand
> > the
> > C-API to support this stuff. Perhaps we don't have to.
>
> So is there an equivalent NA_FromDimsAndData?
No. I was making the mistake of thinking there needed to be.
> I have been using
> PyArray_FromDimsAndData.
That's fine and should basically work.
Between numarray and Numeric there is currently the not-so-subtle
difference that numarray copies the external data buffer and Numeric
just refers to it.
This is a documented difference, but my vote is for changing in favor
of better functionality and Numeric compatibility. I'll probably just
quietly change it unless there is a deluge of dissenters...
--
Todd Miller <jmiller at stsci.edu>
More information about the NumPy-Discussion
mailing list