Python DB-API to numpy

Recently, I was looking for “best practices” for getting data from MySQL to a numpy array. Thanks to Tim Hochberg on the numpy mailing list, we get the following as the apparently fastest way to bridge the DB-numpy gap:

# CREATE TABLE demo (x REAL, y REAL)
c = conn.cursor()
c.execute('SELECT * FROM demo')
y = numpy.fromiter(c, dtype=[('a',float), ('b', float)])

At least, it was the fastest back in 2006.

GSIV and the Python Imaging Library dying on large image

Summary: The GSIV tilemaker.py script dies when attempting to create a large (16384x16384) blank PIL Image object, simply saying “Killed”. The only solution I’ve found is to resize the image to below 8192x8192 before running the script.
Read More