[Numpy-discussion] dedicated function for resize with averaging or rebin 2d arrays?

Andrea Zonca zonca at deepspace.ucsb.edu
Fri Nov 11 01:41:21 EST 2011


hi,
I work in astrophysics where the most common programming language is
currently IDL.
A common request of people switching from IDL to python is the
implementation of the REBIN function, which either downsizes a 2d
array by averaging or increases its dimension by repeating its
elements. In both cases the new shape must be an integer factor of the
old shape.

I believe it is a very handy function for quick smoothing of 2 dimensional data.

I found a discussion about this topic in the archives:
http://thread.gmane.org/gmane.comp.python.numeric.general/885/focus=894

Do you think it would be useful to add such function to numpy?

I created a simple implementation to help in the discussion:
https://gist.github.com/1348792

thanks,
Andrea Zonca



More information about the NumPy-Discussion mailing list