Re: [Numpy-discussion] NumPy-Discussion Digest, Vol 38, Issue 52

2009-11-16 Thread Christopher Barker
oops, I meant to include my code with that last note. Here it is. accumulator.py: is my implementation. easy_scale.py: is Jake's suggested implementation. profile_accumulator.py: contains some test functions that can be run with ipython's "timeit" test_accumulator.py: is test code that can

Re: [Numpy-discussion] NumPy-Discussion Digest, Vol 38, Issue 52

2009-11-16 Thread Christopher Barker
Jake VanderPlas wrote: > It sounds like all of this could be done very simply without going to > C, using a class based on numpy.ndarray. The following works for 1D > arrays, behaves like a regular 1D numpy array, and could be easily > improved with a little care. Is this what you had in mind? >

Re: [Numpy-discussion] NumPy-Discussion Digest, Vol 38, Issue 52

2009-11-12 Thread Jake VanderPlas
> I'm rapidly losing interest here. Perhaps you could supply some code > implementing this new array? Why not just a class using an array that > doubles the array size when an index is out of bounds and copies over the > old data. That is pretty much what realloc does. As to python lists, do you >