Re: [Numpy-discussion] Testing the python buffer protocol (bf_getbuffer / tp_as_buffer)

2011-12-16 Thread Torgil Svensson
What happens if you use y=numpy.frombuffer(x) ? //Torgil On Sat, Dec 17, 2011 at 1:41 AM, Soeren Sonnenburg wrote: > Hi, > > I've implemented the buffer protocol > (http://www.python.org/dev/peps/pep-3118/) for some matrix class and > when I manually call PyObject_GetBuffer on that object I se

Re: [Numpy-discussion] Array min from argmin along an axis?

2011-12-16 Thread Torgil Svensson
> |6> y[np.argmin(y, axis=0), np.arange(y.shape[1])] > array([0, 0, 0, 0, 0]) Can xrange in this case save me from creating a temporary array here or doesn't it matter? |6> y[np.argmin(y, axis=0), xrange(y.shape[1])] array([0, 0, 0, 0, 0]) //Torgil On Tue, Dec 13, 2011 at 11:27 PM, Robert Kern

[Numpy-discussion] Testing the python buffer protocol (bf_getbuffer / tp_as_buffer)

2011-12-16 Thread Soeren Sonnenburg
Hi, I've implemented the buffer protocol (http://www.python.org/dev/peps/pep-3118/) for some matrix class and when I manually call PyObject_GetBuffer on that object I see that I get the right matrix. Now I'd like to see numpy use the buffer protocol of my class. Does anyone know how to test that?

Re: [Numpy-discussion] Problem installing NumPy with Python 3.2.2/MacOS X 10.7.2

2011-12-16 Thread Charles R Harris
On Fri, Dec 16, 2011 at 4:07 PM, McNicol, Adam wrote: > ** > > Hi There, > > I am very new to numpy and have really only started investigating it as > one of my students needs some functionality from matplotlib. I have managed > to install everything under Windows for work in class but I use a Mac

Re: [Numpy-discussion] Problem installing NumPy with Python 3.2.2/MacOS X 10.7.2

2011-12-16 Thread Benjamin Root
On Friday, December 16, 2011, McNicol, Adam wrote: > Hi There, > > I am very new to numpy and have really only started investigating it as one of my students needs some functionality from matplotlib. I have managed to install everything under Windows for work in class but I use a Mac at home and h

[Numpy-discussion] Problem installing NumPy with Python 3.2.2/MacOS X 10.7.2

2011-12-16 Thread McNicol, Adam
Hi There, I am very new to numpy and have really only started investigating it as one of my students needs some functionality from matplotlib. I have managed to install everything under Windows for work in class but I use a Mac at home and have been struggling all night to get it to build and i

Re: [Numpy-discussion] Owndata flag

2011-12-16 Thread Dag Sverre Seljebotn
On 12/16/2011 04:16 PM, Fabrice Silva wrote: > Le vendredi 16 décembre 2011 à 15:33 +0100, Gregor Thalhammer a écrit : >>> Even better: the addendum! >>> http://blog.enthought.com/python/numpy/simplified-creation-of-numpy-arrays-from-pre-allocated-memory/ >>> >>> Within cython: >>> cimport numpy >>

Re: [Numpy-discussion] Owndata flag

2011-12-16 Thread Fabrice Silva
Le vendredi 16 décembre 2011 à 15:33 +0100, Gregor Thalhammer a écrit : > > Even better: the addendum! > > http://blog.enthought.com/python/numpy/simplified-creation-of-numpy-arrays-from-pre-allocated-memory/ > > > > Within cython: > > cimport numpy > > numpy.set_array_base(my_ndarray, PyCObject_

Re: [Numpy-discussion] Owndata flag

2011-12-16 Thread Gregor Thalhammer
Am 16.12.2011 um 11:53 schrieb Fabrice Silva: > Le jeudi 15 décembre 2011 à 18:09 +0100, Gregor Thalhammer a écrit : > >> There is an excellent blog entry from Travis Oliphant, that describes >> how to create a ndarray from existing data without copy: >> http://blog.enthought.com/?p=62 >> The cr

Re: [Numpy-discussion] Owndata flag

2011-12-16 Thread Fabrice Silva
Le jeudi 15 décembre 2011 à 18:09 +0100, Gregor Thalhammer a écrit : > There is an excellent blog entry from Travis Oliphant, that describes > how to create a ndarray from existing data without copy: > http://blog.enthought.com/?p=62 > The created array does not actually own the data, but its base