Re: [Numpy-discussion] Numarrays from C arrays without copying
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
On Thu, 2004-04-22 at 11:47, Paul F. Dubois 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.
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
On Thu, 2004-04-22 at 14:34, Craig Rasmussen wrote:
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@stsci.edu>
![](https://secure.gravatar.com/avatar/faf9400121dca9940496a7473b1d8179.jpg?s=120&d=mm&r=g)
On Thu, 2004-04-22 at 14:34, Craig Rasmussen wrote:
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@stsci.edu>
participants (2)
-
Craig Rasmussen
-
Todd Miller