I once wrote a generic n-dimensional binning routine in C that I could find if
anyone is interested in integrating it into numpy... it didn't do size
increases though... and I think I implemented it so that binning by a
non-divisible factor trimmed the extras. It was very-very fast though.
O
Hi,
I think the usefulness of the rebin function is to be simple and fast,
and the best would be to implement it in the core numpy, as a simple
method for smoothing and reshaping, without the need of using scipy.
For anything more sophisticated, the ndimage module as you suggest
should be used.
che
Hi Andrea,
scipy.ndimage.zoom will do this nicely for magnification. (Just set the spline
order to 0 to get nearest-neighbor interpolation; otherwise you can use higher
orders for better smoothing.)
For decimation (zooming out) scipy.ndimage.zoom also works, but it's not as
nice as a dedicated