title: numpy: padding array with zeros
body: <p>I am working with images and I want to pad numpy array with zeros.
  I looked at <a href="https://docs.scipy.org/doc/numpy/reference/generated/numpy.pad.html/%22np.pad%22" rel="nofollow noreferrer">np.pad</a> </p>
  
  <p>For padding single array it works fine</p>
  
  <pre><code>x = np.array([[1,2],[3,4]])
  y = np.pad(x,(1,1), 'constant')
  
  x
  =&gt; array([[1, 2],
         [3, 4]])
  y
  =&gt; array([[0, 0, 0, 0],
         [0, 1, 2, 0],
         [0, 3, 4, 0],
         [0, 0, 0, 0]])
  </code></pre>
  
  <p>How to implement if we have <code>x type</code> arrays in a list/array , like</p>
  
  <pre><code>c_x=np.array([[[2,2],[2,3]],[[3,2],[2,3]],[[4,4],[2,3]]])
  c_y=np.pad(c_x,((0,0),(1,1),(0,0)),'constant')  #padding is present only on top and bottom
  </code></pre>
  
  <p>As such arrays contains R,G,B channel, Can that too be accounted when padding?</p>
  
  <p><strong>edit:</strong></p>
  
  <p>Say <code>c_x</code> stores list of 10 images on 28x28 pixels with RGB channel</p>
  
  <p>Now I want to pad all 10 images , So after modifying 10 images are of 30x30 with pixels on border as <code>[0,0,0]</code></p>