Skip to content

Instantly share code, notes, and snippets.

@gazzar
gazzar / rebin.py
Created April 9, 2014 08:22 — forked from zonca/rebin.py
import numpy as np
def rebin(a, new_shape):
"""
Resizes a 2d array by averaging or repeating elements,
new dimensions must be integral factors of original dimensions
Parameters
----------
a : array_like