Use of PyArray_FromAny() with a PyArrayInterface object
Hi, I'm trying to understand (but perhaps everything is in the numpy book in which case I'd rather buy the book immediately) how to use the PyArray_FromAny() function. Suppose I have a C object (created by Pyrex or SWIG or Boost.Python) that has the __array_struct__ attribute. Can I pass this object to the PyArray_FromAny() function to get a PyArrayObject ? If it is not the case, if I have a PyCObject created with a PyArrayInterface, is it possible ? I read on a mailing-list that there is the context argument that can be passed to an __array__ method. What is the purpose of this __array__ method ? I don't recollect anything regarding this method :( Matthieu
On Fri, 12 Oct 2007, Matthieu Brucher apparently wrote:
I'm trying to understand (but perhaps everything is in the numpy book in which case I'd rather buy the book immediately) how to use the PyArray_FromAny() function.
This function is discussed in the NumPy Book. I see perhaps a dozen references to the function in the Complete API chapter. Even apart from that chapter, which is useful to you but not to me, I have found the book to be excellent. Cheers, Alan Isaac
2007/10/12, Alan G Isaac <aisaac@american.edu>:
On Fri, 12 Oct 2007, Matthieu Brucher apparently wrote:
I'm trying to understand (but perhaps everything is in the numpy book in which case I'd rather buy the book immediately) how to use the PyArray_FromAny() function.
This function is discussed in the NumPy Book. I see perhaps a dozen references to the function in the Complete API chapter.
Even apart from that chapter, which is useful to you but not to me, I have found the book to be excellent.
Excellent, thank you for the tip, the book is now ordered :) Matthieu
Matthieu Brucher wrote:
2007/10/12, Alan G Isaac <aisaac@american.edu>:
On Fri, 12 Oct 2007, Matthieu Brucher apparently wrote:
I'm trying to understand (but perhaps everything is in the numpy book in which case I'd rather buy the book immediately) how to use the PyArray_FromAny() function.
This function is discussed in the NumPy Book. I see perhaps a dozen references to the function in the Complete API chapter.
Even apart from that chapter, which is useful to you but not to me, I have found the book to be excellent.
Excellent, thank you for the tip, the book is now ordered :)
Matthieu I don't see the text string '__array' anywhere in this book.
Neal Becker wrote:
Matthieu Brucher wrote:
2007/10/12, Alan G Isaac <aisaac@american.edu>:
On Fri, 12 Oct 2007, Matthieu Brucher apparently wrote:
I'm trying to understand (but perhaps everything is in the numpy book in which case I'd rather buy the book immediately) how to use the PyArray_FromAny() function.
This function is discussed in the NumPy Book. I see perhaps a dozen references to the function in the Complete API chapter.
Even apart from that chapter, which is useful to you but not to me, I have found the book to be excellent.
Excellent, thank you for the tip, the book is now ordered :)
Matthieu
I don't see the text string '__array' anywhere in this book.
Perhaps PDF searching cannot see "bold" text. But, take a look at page 74. -Travis
participants (4)
-
Alan G Isaac
-
Matthieu Brucher
-
Neal Becker
-
Travis E. Oliphant