Re: [Numpy-discussion] block matrix and sums of blocks

2009-02-23 Thread Xavier Gnata
Robert Kern wrote: > On Sun, Feb 22, 2009 at 19:39, Xavier Gnata wrote: > >> Hi, >> >> Let us consider one kN x kM array. >> What is the fastest way to sum each k x k square block of A and to put >> all these results into a NxM array B? >> >> For instance: >> If A = >> [112233 >> 112233 >> 22

Re: [Numpy-discussion] block matrix and sums of blocks

2009-02-22 Thread Robert Kern
On Sun, Feb 22, 2009 at 19:39, Xavier Gnata wrote: > Hi, > > Let us consider one kN x kM array. > What is the fastest way to sum each k x k square block of A and to put > all these results into a NxM array B? > > For instance: > If A = > [112233 > 112233 > 223311 > 223311] > then B = > [4 8 12

Re: [Numpy-discussion] block matrix and sums of blocks

2009-02-22 Thread Charles R Harris
On Sun, Feb 22, 2009 at 6:39 PM, Xavier Gnata wrote: > Hi, > > Let us consider one kN x kM array. > What is the fastest way to sum each k x k square block of A and to put > all these results into a NxM array B? > > For instance: > If A = > [112233 > 112233 > 223311 > 223311] > then B = > [4 8 1

Re: [Numpy-discussion] block matrix and sums of blocks

2009-02-22 Thread Charles R Harris
On Sun, Feb 22, 2009 at 6:39 PM, Xavier Gnata wrote: > Hi, > > Let us consider one kN x kM array. > What is the fastest way to sum each k x k square block of A and to put > all these results into a NxM array B? > > For instance: > If A = > [112233 > 112233 > 223311 > 223311] > then B = > [4 8 1

[Numpy-discussion] block matrix and sums of blocks

2009-02-22 Thread Xavier Gnata
Hi, Let us consider one kN x kM array. What is the fastest way to sum each k x k square block of A and to put all these results into a NxM array B? For instance: If A = [112233 112233 223311 223311] then B = [4 8 12 4 12 4] No sanity checks on the arrays shapes are requiered. Only speed mat