title: Initialize numpy array of specific shape with specific values
body: <p>Hi numpy beginner here:</p>
  
  <p>I'm trying to create an array of shape NxWxHx2 initialized with the corresponding index values. in this case W=H always. </p>
  
  <p>e.g.: for an array of shape Nx5x5x2, if I would write it on Paper it should be:</p>
  
  <p>N times the following</p>
  
  <hr>
  
  <p>(0,0) (0,1) (0,2) (0,3) (0,4)</p>
  
  <p>(1,0) (1,1) (1,2) (1,3) (1,4)</p>
  
  <p>(2,0) (2,1) (2,2) (2,3) (2,4)</p>
  
  <p>(3,0) (3,1) (3,2) (3,3) (3,4)</p>
  
  <p>(4,0) (4,1) (4,2) (4,3) (4,4)</p>
  
  <hr>
  
  <p>I looked into the "arange" fkt as well as extending arrays with "newaxis" but couldn't manage to get the desired result.</p>
  
  <p>sorry for the terrible formating.</p>
  
  <p>thanks for the help!</p>
  
  <p>edit: I came up with something like this but it isn't nice.
  for an array of shape 1x3x3x2</p>
  
  <pre><code>t = np.empty([1,3,3,2])
  for n in range(1):
      for i in range(3):
          for p in range(3):
              for r in range(2):
                  if r == 0:
                      t[n,i,p,r]=i
                  else:
                      t[n,i,p,r]=p    
  </code></pre>