title: Convert 3x3 array of 2x2 arrays to a 6x6 array maintaining position
body: <p>I have a 3x3x4 array, each of the 3x3 subarrays (4-tuples, or 1x4 arrays) I want to map to a 2x2 array and stitch them together to form a 6x6 array. I'm having difficulty explaining this in words, so I hope the below illustration helps:</p>
  <p>Here's a 3x3 array of 1x4 arrays, named <code>1</code> through <code>9</code>:</p>
  <pre><code>1 2 3
  4 5 6
  7 8 9
  </code></pre>
  <p>Each 1x4 array above is enumerated below:</p>
  <pre><code>1 = [a, b, c, d]
  2 = [e, f, g, h]
  3 = [i, j, k, l]
  4 = [m, n, o, p]
  5 = [q, r, s, t]
  6 = [u, v, w, x]
  7 = [y, z, !, @]
  8 = [#, $, %, ^]
  9 = [&amp;, *, (, )]
  </code></pre>
  <p>I want to convert this 3x3x4 array to a bigger 6x6 array:</p>
  <pre><code>a b e f i j
  c d g h k l
  m n q r u v
  o p s t w x
  y z # $ &amp; *
  ! @ % ^ ( )
  </code></pre>
  <p>You'll see the top-left 2x2 corresponds to the 1st 1x4 array, the top-center 2x2 is the 2nd 1x4 array, and so on.</p>
  <p><a href="https://i.stack.imgur.com/kSUmS.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/kSUmS.jpg" alt="enter image description here" /></a></p>
  <p>As in the image above, <code>1</code> became <code>a b c d</code> in a 2x2 sub-array, <code>2</code> became <code>e f g h i</code> in a 2x2 sub-array. These are part of the larger 6x6 array.</p>
  <p>I'm not sure programmatically how to do this, any ideas?</p>
  <p>Here's some starter code:</p>
  <pre class="lang-py prettyprint-override"><code>#!/usr/bin/env python3
  
  from random import uniform
  
  # original array is 3x3
  old_width = 3
  old_height = 3
  # subarray size
  sub_width = 2
  sub_height = 2
  # new array is function of the above four
  new_width = old_width*sub_width
  new_height = old_height*sub_height
  
  def rand_subarray():
    # makes a 1x4 subarray
    return [uniform(0.00, 1.00) for _ in range(sub_width*sub_height)]
  
  def generate_map():
    # makes a 3x3 array of 1x4 subarrays
    return [[rand_subarray() for _ in range(old_width)] for _ in range(old_height)]
  
  if __name__ == '__main__':
    map = generate_map()
  </code></pre>
  <p>If it makes a difference, this is for a self organizing map.</p>