title: How to create a 2D binary array with 1's forming a "diamond" shape
body: <p>I need to create a function that results in a diamond shape when given a side length. The diamond array should consist of values of 0 and 1.</p>
  <p>So far I figured out how to make the diamond, I don't know how to program a function for different side lengths</p>
  <p>So far I have this solution for a side length of 3:</p>
  <pre><code>import numpy as np
  
  #line1
  a=np.zeros(3+2)
  a[3-1]=1
  
  #line2
  b=np.zeros(3+2)
  b[3-2]=1
  b[3]=1
  
  #line3
  c=np.zeros(3+2)
  c[3-3]=1
  c[3+1]=1
  
  print(np.concatenate((a,b,c,b,a),axis=1).reshape(5,5))
  </code></pre>
  <p>How could I write a function for different lengths?<br />
  Also, if given a length of 1 it should return <code>[[1]]</code></p>