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

2011-12-17 Thread Soeren Sonnenburg
Doesn't work, complaining that the object has no __buffer__ attribute. Digging into the numpy c code it seems numpy doesn't even support the buffer protocol but only the deprecated (old) one http://docs.python.org/c-api/objbuffer.html . At least there is nowhere a PyObject_CheckBuffer() call but

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

2011-12-17 Thread Ralf Gommers
On Sat, Dec 17, 2011 at 1:21 AM, Charles R Harris charlesr.har...@gmail.com wrote: On Fri, Dec 16, 2011 at 4:07 PM, McNicol, Adam amcni...@longroad.ac.ukwrote: ** Hi There, I am very new to numpy and have really only started investigating it as one of my students needs some

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

2011-12-17 Thread McNicol, Adam
Hi There, Thanks for the responses. At this point I would settle from just being able to install matplotlib. Even if some of the functionality isn't present currently that is fine. I'm afraid my knowledge of Python falls down about here as well. I installed Python 3.2.2 via the installer

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

2011-12-17 Thread mark florisson
What version of numpy are you using? IIRC the new buffer protocol has been supported since numpy 1.5. On 17 December 2011 08:42, Soeren Sonnenburg so...@debian.org wrote: Doesn't work, complaining that the object has no __buffer__ attribute. Digging into the numpy c code it seems numpy doesn't

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

2011-12-17 Thread Pauli Virtanen
17.12.2011 09:42, Soeren Sonnenburg kirjoitti: Doesn't work, complaining that the object has no __buffer__ attribute. Digging into the numpy c code it seems numpy doesn't even support the buffer protocol but only the deprecated (old) one http://docs.python.org/c-api/objbuffer.html . [clip]

[Numpy-discussion] strange conversion integer to float

2011-12-17 Thread Alex van Houten
Try this: $ python Python 2.7.1 (r271:86832, Apr 12 2011, 16:15:16) [GCC 4.6.0 20110331 (Red Hat 4.6.0-2)] on linux2 Type help, copyright, credits or license for more information. import numpy as np np.__version__ '1.5.1' time=[] time.append(20091231) time_array=np.array(time,'f')

Re: [Numpy-discussion] strange conversion integer to float

2011-12-17 Thread Matthieu Brucher
Hi, If I remember correctly, float is a double (precision float). The precision is more important in doubles (float64) than in usual floats (float32). And 20091231 can not be reprensented in 32bits floats. Matthieu 2011/12/17 Alex van Houten sparrow2...@yahoo.com Try this: $ python Python

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

2011-12-17 Thread Soeren Sonnenburg
On Sat, 2011-12-17 at 15:29 +0100, Pauli Virtanen wrote: 17.12.2011 09:42, Soeren Sonnenburg kirjoitti: Doesn't work, complaining that the object has no __buffer__ attribute. Digging into the numpy c code it seems numpy doesn't even support the buffer protocol but only the deprecated

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

2011-12-17 Thread Pauli Virtanen
18.12.2011 00:49, Soeren Sonnenburg kirjoitti: [clip] I've looked at the source code of numpy 1.6.1 and couldn't find the respective code... I guess I must be doing something wrong but there really was no call to PyObject_CheckBuffer() ... Look for PyObject_GetBuffer The problem is I don't