title: What's the most efficient way to convert a MySQL result set to a NumPy array?
body: <p>I'm using MySQLdb and Python.  I have some basic queries such as this:</p>
  
  <pre><code>c=db.cursor()
  c.execute("SELECT id, rating from video")
  results = c.fetchall()
  </code></pre>
  
  <p>I need "results" to be a NumPy array, and I'm looking to be economical with my memory consumption.  It seems like copying the data row by row would be incredibly inefficient (double the memory would be required).  Is there a better way to convert MySQLdb query results into the NumPy array format?</p>
  
  <p>The reason I'm looking to use the NumPy array format is because I want to be able to slice and dice the data easily, and it doesn't seem like python is very friendly to multi-dimensional arrays in that regard.</p>
  
  <pre><code>e.g. b = a[a[:,2]==1] 
  </code></pre>
  
  <p>Thanks!</p>