Numpy slicing on a zero-padded 2D array
Given a 2D Numpy array, I’d like to be able to pad it on the left, right, top, bottom side, like the following pseudo-code. Is there anything like this already built into Numpy?
Given a 2D Numpy array, I’d like to be able to pad it on the left, right, top, bottom side, like the following pseudo-code. Is there anything like this already built into Numpy?