title: Optimal way to append to numpy array
body: <p>I have a numpy array and I can simply append an item to it using append, like this:</p>
  
  <pre><code>numpy.append(myarray, 1)
  </code></pre>
  
  <p>In this case I just appended the integer <code>1</code>.</p>
  
  <p>But is this the quickest way to append to an array? I have a very long array that runs into the tens of thousands.</p>
  
  <p>Or is it better to index the array and assign it directly?
  Like this:</p>
  
  <pre><code>myarray[123] = 1
  </code></pre>