title: Numpy: Joining structured arrays?
body: <h2>Input</h2>
  
  <p>I have many <a href="http://docs.scipy.org/doc/numpy/user/basics.rec.html" rel="noreferrer">numpy structured arrays</a> in a list like this example:</p>
  
  <pre><code>import numpy
  
  a1 = numpy.array([(1, 2), (3, 4), (5, 6)], dtype=[('x', int), ('y', int)])
  
  a2 = numpy.array([(7,10), (8,11), (9,12)], dtype=[('z', int), ('w', float)])
  
  arrays = [a1, a2]
  </code></pre>
  
  <h2>Desired Output</h2>
  
  <p>What is the correct way to join them all together to create a unified structured array like the following?</p>
  
  <pre><code>desired_result = numpy.array([(1, 2, 7, 10), (3, 4, 8, 11), (5, 6, 9, 12)],
                               dtype=[('x', int), ('y', int), ('z', int), ('w', float)])
  </code></pre>
  
  <h2>Current Approach</h2>
  
  <p>This is what I'm currently using, but it is very slow, so I suspect there must be a more efficent way.</p>
  
  <pre><code>from numpy.lib.recfunctions import append_fields
  
  def join_struct_arrays(arrays):
      for array in arrays:
          try:
              result = append_fields(result, array.dtype.names, [array[name] for name in array.dtype.names], usemask=False)
          except NameError:
              result = array
  
      return result
  </code></pre>