title: Python Multidimensional Array - Adding additional values to beginning and end of each row
body: <p>How do I add 0's to the beginning and end of each row of a multidimensional array? This is the function I am trying to apply to each row.</p>
  
  <pre><code>def zero(ltr):
    for x in range (1,int((N+1)/2)):
          ltr = append(([0]), ltr)
          ltr = append(ltr,([0]))
    return ltr 
  </code></pre>
  
  <p>I have tried using both </p>
  
  <pre><code>for row in a:
     zero(row)
  </code></pre>
  
  <p>and 
  <code>apply_along_axis(zero,1,a)</code> 
  Neither one of these commands does what I want.</p>