[Numpy-discussion] Resize Method for Numpy Array

"V. Armando Solé" sole@esrf...
Thu Sep 24 10:41:40 CDT 2009


V. Armando Solé wrote:

Sorry, there was a bug in the sent code. It should be:

> import numpy
> a=numpy.arange(100.)
> a.shape = 10, 10
> b = a * 1 # just to get a copy
> b.shape = 5, 2, 5, 2
> b = (b.sum(axis=3)).sum(axis=1)
>
> In that way, on b I have a binned image of a.




More information about the NumPy-Discussion mailing list