def resize(scale, old_mats): new_mats = [] for mat in old_mats: new_mats.append(zoom(mat, scale, order=0)) return np.array(new_mats)