Re: [Numpy-discussion] Memory allocation cleanup

2014-01-10 Thread Julian Taylor
On 10.01.2014 17:03, Nathaniel Smith wrote: > On Fri, Jan 10, 2014 at 9:18 AM, Julian Taylor > wrote: >> On Fri, Jan 10, 2014 at 3:48 AM, Nathaniel Smith wrote: >>> [...] >> >> For this reason and missing calloc I don't think we should use the Python >> API for data buffers just yet. Any benefits

[Numpy-discussion] Bug in resize of structured array (with initial size = 0)

2014-01-10 Thread Nicolas Rougier
Hi, I've tried to resize a record array that was first empty (on purpose, I need it) and I got the following error (while it's working for regular array). Traceback (most recent call last): File "test_resize.py", line 10, in print np.resize(V,2) File "/usr/locaL/Cellar/python/2.7.6/Fr

Re: [Numpy-discussion] Why do weights in np.polyfit have to be 1D?

2014-01-10 Thread Charles R Harris
On Fri, Jan 10, 2014 at 9:03 AM, Andreas Hilboll wrote: > Hi, > > in using np.polyfit (in version 1.7.1), I ran accross > >TypeError: expected a 1-d array for weights > > when trying to fit k polynomials at once (x.shape = (4, ), y.shape = (4, > 136), w.shape = (4, 136)). Is there any specifi

[Numpy-discussion] Why do weights in np.polyfit have to be 1D?

2014-01-10 Thread Andreas Hilboll
Hi, in using np.polyfit (in version 1.7.1), I ran accross TypeError: expected a 1-d array for weights when trying to fit k polynomials at once (x.shape = (4, ), y.shape = (4, 136), w.shape = (4, 136)). Is there any specific reason why this is not supported? -- Andreas. __

Re: [Numpy-discussion] Memory allocation cleanup

2014-01-10 Thread Nathaniel Smith
On Fri, Jan 10, 2014 at 9:18 AM, Julian Taylor wrote: > On Fri, Jan 10, 2014 at 3:48 AM, Nathaniel Smith wrote: >> >> Also, none of the Py* interfaces implement calloc(), which is annoying >> because it messes up our new optimization of using calloc() for >> np.zeros. [...] > > > Another thing th

Re: [Numpy-discussion] Memory allocation cleanup

2014-01-10 Thread Frédéric Bastien
On Fri, Jan 10, 2014 at 4:18 AM, Julian Taylor wrote: > On Fri, Jan 10, 2014 at 3:48 AM, Nathaniel Smith wrote: >> >> On Thu, Jan 9, 2014 at 11:21 PM, Charles R Harris >> wrote: >> > [...] >> >> After a bit more research, some further points to keep in mind: >> >> Currently, PyDimMem_* and PyArr

Re: [Numpy-discussion] Memory allocation cleanup

2014-01-10 Thread Julian Taylor
On Fri, Jan 10, 2014 at 3:48 AM, Nathaniel Smith wrote: > On Thu, Jan 9, 2014 at 11:21 PM, Charles R Harris > wrote: > > [...] > > After a bit more research, some further points to keep in mind: > > Currently, PyDimMem_* and PyArray_* are just aliases for malloc/free, > and PyDataMem_* is an ali