[Numpy-discussion] block matrix and sums of blocks
Charles R Harris
charlesr.harris@gmail....
Sun Feb 22 19:51:48 CST 2009
On Sun, Feb 22, 2009 at 6:39 PM, Xavier Gnata <xavier.gnata@gmail.com>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
> 4 12 4]
>
> No sanity checks on the arrays shapes are requiered. Only speed matters ;)
>
> Xavier
> _______________________________________________
> Numpy-discussion mailing list
> Numpy-discussion@scipy.org
> http://projects.scipy.org/mailman/listinfo/numpy-discussion
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://projects.scipy.org/pipermail/numpy-discussion/attachments/20090222/86b6454f/attachment.html
More information about the Numpy-discussion
mailing list