How can I add one row and one column to a numpy array. The array has the shape (480,639,3) and I want to have the shape (481,640,3). The new row and column should filled with zeros, like this:
[43,42,40], ... [64,63,61], [0,0,0]
... ... ... [0,0,0]
[29,29,29], ... [38,37,35], [0,0,0]
[0,0,0], [0,0,0] ... [0,0,0]
To add a new column I'm doing this:
b = numpy.zeros((480,640,3), dtype = int)
b[:,:-1] = old_arry
But how I can add one row? Have I to use a loop or exists a better way to do this?
b[:-1, :-1, :]