title: Using asarray returns TypeError: readable buffer object error
body: <p>I have a list, which basically looks like:</p>
  
  <pre><code>toLocArray
  
  &gt;&gt;[['Location 1', 'RAILS', 0.10520972, 20000], 
  ['Location 2', 'ROADS', 0.377652629, 20000], 
  ['Location 3', 'RAILS', 0.12588421, 20000], 
  ['Location 4', 'ROADS', 0.377652629, 20000]]
  </code></pre>
  
  <p>I wish to cast it as an ndarray, with a specified dtype:</p>
  
  <pre><code>dtype = [('toLoc', 'a50'),('Network', 'a10'), ('timeCost', 'f8'),   ('toLocCapacity', 'i4')]
  toLocArray = np.asarray(toLocArray, dtype=dtype)
  </code></pre>
  
  <p>However, I get the following error:</p>
  
  <pre><code>     89     dtype = [('toLoc', 'a50'),('Network', 'a10'), ('timeCost', 'f8'), ('toLocCapacity', 'i4')]
  ---&gt; 90     toLocArray = np.asarray(toLocArray,dtype=dtype)
       91 
       92 
  
  C:[path]\site-packages\numpy\core\numeric.pyc in asarray(a, dtype, order)
      460 
      461     """
  --&gt; 462     return array(a, dtype, copy=False, order=order)
      463 
      464 def asanyarray(a, dtype=None, order=None):
  
  TypeError: expected a readable buffer object 
  </code></pre>
  
  <p>From what I've read this sort of error occurs when trying to set a value with the wrong type, but I don't see how I could be doing that here.  I can get the asarray function to work if I don't use the "dtype=" clause, but I need the fields to be defined.  What am I doing wrong?</p>