title: Building up an array in numpy/scipy by iteration in Python?
body: <p>Often, I am building an array by iterating through some data, e.g.:</p>
  
  <pre><code>my_array = []
  for n in range(1000):
    # do operation, get value 
    my_array.append(value)
  # cast to array
  my_array = array(my_array)
  </code></pre>
  
  <p>I find that I have to first build a list and then cast it (using "array") to an array. Is there a way around these? All these casting calls clutter the code... how can I iteratively build up "my_array", with it being an array from the start?</p>