title: Growing matrices columnwise in NumPy
body: <p>In pure Python you can grow matrices column by column pretty easily:</p>
  
  <pre><code>data = []
  for i in something:
      newColumn = getColumnDataAsList(i)
      data.append(newColumn)
  </code></pre>
  
  <p><a href="http://en.wikipedia.org/wiki/NumPy" rel="noreferrer">NumPy</a>'s array doesn't have the append function. The <code>hstack</code> function doesn't work on zero sized arrays, thus the following won't work:</p>
  
  <pre><code>data = numpy.array([])
  for i in something:
      newColumn = getColumnDataAsNumpyArray(i)
      data = numpy.hstack((data, newColumn)) # ValueError: arrays must have same number of dimensions
  </code></pre>
  
  <p>So, my options are either to remove the initalization iside the loop with appropriate condition:</p>
  
  <pre><code>data = None
  for i in something:
      newColumn = getColumnDataAsNumpyArray(i)
      if data is None:
          data = newColumn
      else:
          data = numpy.hstack((data, newColumn)) # works
  </code></pre>
  
  <p>... or to use a Python list and convert is later to array:</p>
  
  <pre><code>data = []
  for i in something:
      newColumn = getColumnDataAsNumpyArray(i)
      data.append(newColumn)
  data = numpy.array(data)
  </code></pre>
  
  <p>Both variants seem a little bit awkward to be. Are there nicer solutions?</p>