title: Python: append to numpy array
body: <p>In some cases the original numpy array is desired to be overwritten by the concatenated numpy array. 
  I want to discuss an exemplar case of a numpy array inside a complex structured array.
  This question arose by answering a question about structured arrays <a href="https://stackoverflow.com/a/27563022/2062965">https://stackoverflow.com/a/27563022/2062965</a> .</p>
  
  <pre><code>import numpy as np
  x = np.zeros(1, dtype = [('Table', float64, (2, 2)),
                           ('Number', float),
                           ('String', '|S10')])
  
  # Append values to the array
  print(np.append(x['Table'], array([[[1], [2]]]), axis=2))
  
  # This assignment will lead to the error message mentioned below:
  x['Table'] = np.append(x['Table'], array([[[1], [2]]]), axis=2)
  </code></pre>
  
  <h3>Similar questions</h3>
  
  <p>There are several ways around, like <code>numpy.append</code>, <code>numpy.concatenate</code>, <code>numpy.vstack</code> or <code>numpy.hstack</code>. </p>
  
  <ul>
  <li><a href="https://stackoverflow.com/q/9775297/2062965">Append a NumPy array to a NumPy array</a></li>
  <li><a href="https://stackoverflow.com/q/20094664/2062965">numpy append array to array</a></li>
  <li><a href="https://stackoverflow.com/q/27185013/2062965">Numpy append to an empty array</a></li>
  </ul>
  
  <p>Each of them creates a new array, which can not be assigned back to the old variable by returning an error message like the following one:</p>
  
  <pre><code>ValueError: could not broadcast input array from shape (1,2,3) into shape (1,2,2)
  </code></pre>
  
  <h3>Possible approach</h3>
  
  <p>I could, as a straight but time-consuming solution, define a new empty numpy array which I fill with the old data and the ones that should be append.</p>
  
  <p>Thank you also for other solutions.</p>