Re: [Numpy-discussion] Dynamic array list implementation

2015-12-31 Thread Chris Barker
On Wed, Dec 30, 2015 at 6:34 AM, Nicolas P. Rougier < nicolas.roug...@inria.fr> wrote: > > > On 28 Dec 2015, at 19:58, Chris Barker wrote: > > > > >>> python benchmark.py > > Python list, append 10 items: 0.01161 > > Array list, append 10 items: 0.46854 > > > > are

Re: [Numpy-discussion] Dynamic array list implementation

2015-12-30 Thread Nicolas P. Rougier
> On 28 Dec 2015, at 19:58, Chris Barker wrote: > > On Wed, Dec 23, 2015 at 4:01 AM, Nicolas P. Rougier > wrote: > But my implementation is quite slow, especially when you add one item at a > time: > > >>> python benchmark.py > Python list,

Re: [Numpy-discussion] Dynamic array list implementation

2015-12-28 Thread Chris Barker
On Wed, Dec 23, 2015 at 4:01 AM, Nicolas P. Rougier < nicolas.roug...@inria.fr> wrote: > But my implementation is quite slow, especially when you add one item at a > time: > > >>> python benchmark.py > Python list, append 10 items: 0.01161 > Array list, append 10 items: 0.46854 > are you

Re: [Numpy-discussion] Dynamic array list implementation

2015-12-24 Thread Chris Barker
On Wed, Dec 23, 2015 at 4:31 AM, Sebastian Berg wrote: > > Probably is a bit orthogonal since I guess you want/need cython, but > pythons builtin array.array should get you there pretty much as well. I don't think it's orthogonal to cython -- you can access an

Re: [Numpy-discussion] Dynamic array list implementation

2015-12-24 Thread Chris Barker
On Thu, Dec 24, 2015 at 10:19 AM, Chris Barker wrote: > I'll try to get the code up on gitHub. > Hey look -- it's already there: https://github.com/PythonCHB/NumpyExtras too many gitHub accounts. Here is the list/growable array/ accumulator:

Re: [Numpy-discussion] Dynamic array list implementation

2015-12-24 Thread Chris Barker
On Wed, Dec 23, 2015 at 4:01 AM, Nicolas P. Rougier < nicolas.roug...@inria.fr> wrote: > > Typed list in numpy would be a nice addition indeed and your cython > implementation is nice (and small). > It seems we have a lot of duplicated effort here. Pernonally, I have two needs: 1) ragged arrays

Re: [Numpy-discussion] Dynamic array list implementation

2015-12-23 Thread Nicolas P. Rougier
Typed list in numpy would be a nice addition indeed and your cython implementation is nice (and small). In my case I need to ensure a contiguous storage to allow easy upload onto the GPU. But my implementation is quite slow, especially when you add one item at a time: >>> python benchmark.py

Re: [Numpy-discussion] Dynamic array list implementation

2015-12-23 Thread Sebastian Berg
On Mi, 2015-12-23 at 00:34 -0800, Stephan Hoyer wrote: > We have a type similar to this (a typed list) internally in pandas, > although it is restricted to a single dimension and far from feature > complete -- it only has .append and a .to_array() method for > converting to a 1d numpy array. Our

Re: [Numpy-discussion] Dynamic array list implementation

2015-12-23 Thread Stephan Hoyer
We have a type similar to this (a typed list) internally in pandas, although it is restricted to a single dimension and far from feature complete -- it only has .append and a .to_array() method for converting to a 1d numpy array. Our version is written in Cython, and we use it for performance

Re: [Numpy-discussion] Dynamic array list implementation

2015-12-22 Thread Chris Barker
sorry for being so lazy as to not go look at the project pages, but This sounds like it could be really useful, and maybe supercise a coupl eof half-baked projects of mine. But -- what does "dynamic" mean? - can you append to these arrays? - can it support "ragged arrrays" -- it looks like

Re: [Numpy-discussion] Dynamic array list implementation

2015-12-22 Thread Nicolas P. Rougier
Yes, you can append/insert/remove items. It works pretty much like a python list in fact (but with a single data type for all elements). Nicolas > On 22 Dec 2015, at 20:19, Chris Barker wrote: > > sorry for being so lazy as to not go look at the project pages, but