Re: [Numpy-discussion] subsampling array without loops

2008-08-27 Thread Stéfan van der Walt
2008/8/26 Anne Archibald <[EMAIL PROTECTED]>: > 2008/8/22 Catherine Moroney <[EMAIL PROTECTED]>: >> I'm looking for a way to acccomplish the following task without lots >> of loops involved, which are really slowing down my code. >> >> I have a 128x512 array which I want to break down into 2x2 squa

Re: [Numpy-discussion] subsampling array without loops

2008-08-25 Thread Anne Archibald
2008/8/22 Catherine Moroney <[EMAIL PROTECTED]>: > I'm looking for a way to acccomplish the following task without lots > of loops involved, which are really slowing down my code. > > I have a 128x512 array which I want to break down into 2x2 squares. > Then, for each 2x2 square I want to do some s

Re: [Numpy-discussion] subsampling array without loops

2008-08-25 Thread Zachary Pincus
> This almost works. Is there a way to do some masking on tiles, for > instance taking the maximum height of each 2x2 square that is an > odd number? I've tried playing around with masking and where, but > they don't return an array of the original size and shape of "tiles" > below. Could you p

Re: [Numpy-discussion] subsampling array without loops

2008-08-25 Thread Pierre GM
On Monday 25 August 2008 14:29:49 Catherine Moroney wrote: > This almost works. Is there a way to do some masking on tiles, for > instance taking the maximum height of each 2x2 square that is an > odd number? I've tried playing around with masking and where, but > they don't return an array of t

Re: [Numpy-discussion] subsampling array without loops

2008-08-25 Thread Catherine Moroney
This almost works. Is there a way to do some masking on tiles, for instance taking the maximum height of each 2x2 square that is an odd number? I've tried playing around with masking and where, but they don't return an array of the original size and shape of "tiles" below. Catherine > Perhaps

Re: [Numpy-discussion] subsampling array without loops

2008-08-22 Thread Zachary Pincus
> I'm looking for a way to acccomplish the following task without lots > of loops involved, which are really slowing down my code. > > I have a 128x512 array which I want to break down into 2x2 squares. > Then, for each 2x2 square I want to do some simple calculations > such as finding the maximum

[Numpy-discussion] subsampling array without loops

2008-08-22 Thread Catherine Moroney
I'm looking for a way to acccomplish the following task without lots of loops involved, which are really slowing down my code. I have a 128x512 array which I want to break down into 2x2 squares. Then, for each 2x2 square I want to do some simple calculations such as finding the maximum value, whic