MySQL Matrix manipulation in Python

Threader Slash threaderslash at
Tue Sep 29 10:00:43 CEST 2009

Hello Everybody,

My doubt is about matrix data manipulation in python - I hope someone can
point me some direction.

I googled around, but there is not much good examples about playing with
matrix in python on internet.

My following function works pretty well, and gives me the outup from my
MySQL db:

* Code:
    def employee(self, verifyName):
        runQuery= """.... = %s"""
        for row in self.cursor.fetchall():
            print row
        print "Number of lines returned: %d" % self.cursor.rowcount
        print "tell column numbers: %d" % len(row)

* output

('John', 'Plumber')
('Bill', 'Driver')
('Mark', 'Lawyer')
Number of lines returned: 3
tell column numbers: 2

Now, how can I transfer this output to provide a matrix with a content like

my_array = [['John','Plumber'],

All comments and suggestions are highly appreciated!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Python-list mailing list