Re: [Numpy-discussion] MaskedArray __setitem__ Performance

2008-02-16 Thread Alexander Michael
On Feb 16, 2008 3:21 PM, Pierre GM <[EMAIL PROTECTED]> wrote: > > Can I safely carry around the data, mask and MaskedArray? I'm > > considering working along the lines of the following conceptual > > outline: > > That depends a lot on what calculate_results does, and whether you update the > arrays

Re: [Numpy-discussion] MaskedArray __setitem__ Performance

2008-02-16 Thread Pierre GM
> Can I safely carry around the data, mask and MaskedArray? I'm > considering working along the lines of the following conceptual > outline: That depends a lot on what calculate_results does, and whether you update the arrays in place or not. > d = numpy.array(shape, dtype) > m = numpy.array(sh

Re: [Numpy-discussion] MaskedArray __setitem__ Performance

2008-02-16 Thread Alexander Michael
On Feb 16, 2008 12:25 PM, Pierre GM <[EMAIL PROTECTED]> wrote: > Alexander, > You get the gist here: process your _data and _mask separately and recombine > them into a MaskedArray at the end. That way, you'll skip most of the > overhead costs brought by some tests in the package (in __getitem__, >

Re: [Numpy-discussion] MaskedArray __setitem__ Performance

2008-02-16 Thread Pierre GM
Alexander, You get the gist here: process your _data and _mask separately and recombine them into a MaskedArray at the end. That way, you'll skip most of the overhead costs brought by some tests in the package (in __getitem__, __setitem__...). ___ Nump

[Numpy-discussion] MaskedArray __setitem__ Performance

2008-02-15 Thread Alexander Michael
In part of some code I'm rewriting from carrying around a data and mask array to using MaskedArray, I read data into an array from an input stream. By its nature this a "one at a time" process, so it is basically a loop over assigning single elements (in no predetermined order) of already allocated