Alternatively, if you want a pad value other than zero, you can use this option
>>> a = np.arange(9.).reshape(3,3)
>>> np.pad(a, 1, 'constant', constant_values=0)
array([[ 0., 0., 0., 0., 0.],
[ 0., 0., 1., 2., 0.],
[ 0., 3., 4., 5., 0.],
[ 0., 6., 7., 8., 0.],
[ 0., 0., 0., 0., 0.]])
>>> np.pad(a, 1, 'constant', constant_values=5)
array([[ 5., 5., 5., 5., 5.],
[ 5., 0., 1., 2., 5.],
[ 5., 3., 4., 5., 5.],
[ 5., 6., 7., 8., 5.],
[ 5., 5., 5., 5., 5.]])