I know anything about mysqldb and fetchone method, but it's easy to create a numpy array, given a tuple of data:
>>> import numpy >>> >>> t = ('1', '2', '3') >>> numpy.array(t, int) array([1, 2, 3]) >>> I made the assumption that mysqldb.fetchone return a tuple of strings, so we need to create an array by specifying the type of the needed values. On Mon, May 24, 2010 at 12:30 AM, Ian Hoffman <ith...@gmail.com> wrote: > Hello, > > I'm having significant Python difficulties (and I'm new to Python). > I'm trying to read BLOB ASCII (numerical) data from a MySQL database > using MySQLdb in a formatted fashion. The BLOB data is a sequence of > numbers separated by newlines (\n), like this: > 5 > 6 > 10 > 45 > etc. > > When I read the data using the fetchone() command I get a single > tuple. What I'd like is to somehow put the tuple into a NumPy array > with each value as one element. Then I can continue to do some > numerical processing. > > Any advice/help? > > -- > http://mail.python.org/mailman/listinfo/python-list > -- Matteo Landi http://www.matteolandi.net/ -- http://mail.python.org/mailman/listinfo/python-list