title: Is it possible to speed-up conversion of a list into an array in python?
body: <p>In my code, I have noticed that the conversion of a list into an array takes a significant amount of time.</p>
  
  <p>I'm wondering if there any faster ways on how to convert a list to an array in python, here are my three attempts:</p>
  
  <pre><code>import numpy as np
  from timeit import  timeit
  from array import array
  
  
  added_data = range(100000)
  
  def test1():
      np.asarray(added_data, dtype=np.float16)
  
  def test2():
      np.array(added_data, dtype=np.float16)
  
  def test3():
      array('f', added_data)
  
  print(timeit(test1,number=100))
  print(timeit(test2,number=100))
  print(timeit(test3,number=100))
  </code></pre>
  
  <p>In other words:</p>
  
  <p><strong>Input:</strong> &lt; type 'list' ></p>
  
  <p><strong>Output:</strong> &lt; type 'array.array' ></p>