> This function does zero-padding of an np.ndarray. As far as I can tell,
> np.resize just makes a new array of desired size and fills it with the
> ravelled original data, repeating if necessary. Not sure how I could
> use it for this.

Good point. How about np.pad?