title: Julia best way to reshape multi-dim array
body: <p>I have a multi-dimensional array:</p>
  
  <pre><code>julia&gt; sim1.value[1:5,:,:]
  5x3x3 Array{Float64,3}:
  [:, :, 1] =
    0.201974   0.881742  0.497407
    0.0751914  0.921308  0.732588
   -0.109084   1.06304   1.15962 
   -0.0149133  0.896267  1.22897 
    0.717094   0.72558   0.456043
  
  [:, :, 2] =
    1.28742  0.760712  1.61112
    2.21436  0.229947  1.87528
   -1.66456  1.46374   1.94794
   -2.4864   1.84093   2.34668
   -2.79278  1.61191   2.22896
  
  [:, :, 3] =
   0.649675  0.899028  0.628103
   0.718837  0.665043  0.153844
   0.914646  0.807048  0.207743
   0.612839  0.790611  0.293676
   0.759457  0.758115  0.280334
  </code></pre>
  
  <p>I have names for the 2nd dimension in </p>
  
  <pre><code>julia&gt; sim1.names
  3-element Array{String,1}:
   "beta[1]"
   "beta[2]"
   "s2" 
  </code></pre>
  
  <p>Whats best way to reshape this multi-dim array so that I have a data frame like:</p>
  
  <pre><code> beta[1]  | beta[2]   | s2       | chain
   0.201974 |  0.881742 | 0.497407 |   1
   0.0751914|  0.921308 | 0.732588 |   1
  -0.109084 |  1.06304  | 1.15962  |   1
  -0.0149133|  0.896267 | 1.22897  |   1
   ...      |  ...      | ...      |   ...
   1.28742  |  0.760712 | 1.61112  |   2
   2.21436  |  0.229947 | 1.87528  |   2
  -1.66456  |  1.46374  | 1.94794  |   2
  -2.4864   |  1.84093  | 2.34668  |   2
  -2.79278  |  1.61191  | 2.22896  |   2
   ...      |  ...      | ...      |   ...
  </code></pre>