title: Creating a list or array with a fixed size?
body: <p>I want to create an array or list which only contains 3 entries at any given time. The function should loop and with each loop 1 entry will be added to the list pushing the oldest value out and then a value will be calculated based on the 3 values in the list.</p>
  
  <p>I have tried:</p>
  
  <pre><code>import numpy as np
  
  z = np.ndarray((3,),float)
  
  np.append(z, [12, 14.56, 12.46, 1.56])
  </code></pre>
  
  <p>which creates a numpy array with only 3 values (afaik) however the array is populated with strange values:</p>
  
  <pre><code>z= ([  1.56889217e-163,   1.01899555e-297,   1.03395110e-297])
  </code></pre>
  
  <p>anyone know why/what I'm doing wrong or have a better solution for what I want to do?</p>