title: Python Typed Array of a Certain Size
body: <p>This will create an empty array of type <code>signed int</code>:</p>
  
  <pre><code>import array
  a = array.array('i')
  </code></pre>
  
  <p>What is an efficient (performance-wise) way to specify the array lengh (as well as the array's rank - number of dimensions)?</p>
  
  <p>I understand that <code>NumPy</code> allows to specify array size at creation, but can it be done in standard Python?</p>
  
  <p><a href="https://stackoverflow.com/questions/6142689">Initialising an array of fixed size in python</a><br>
  This deals mostly with lists, as well as no consideration is given to performance. The main reason to use an array instead of a list is performance.</p>