> If you don't mind, I'd have one further question. I read the query results
> named "output" with Python. Why is it a list of tuples?? It's not very
> handy...
 
> >>print output
> [(12.2817, 12.2817), (0, 0), (8.52, 8.52)]
 
> It seems to be a list of tuples as far as I know Python. 

That is correct.  Each row is a tuple of column data values.  If you ask for a 
bunch of rows at once you get a list of Rows.

> I would like to either convert "output" in a simple 1D array (=list in Python 
> I guess):
> [12.2817, 12.2817, 0, 0, 8.52, 8.52]

bag = [c for c in [r for r in data]]

Though you would probably be better off dealing with the data as a list of rows 
or only ask for one row at a time if that is what you want.
 
> or a 2x3 matrix:

It is a matrix.

> 12.2817 12.2817
> 0          0
> 8.52     8.52
> 
> to be read via "output[i][j]"

Where i is the row and j is the column.  That is exactly the format if you 
retrieve multiple rows.

A list of tuples.

Occasionally called a matrix.


---
()  ascii ribbon campaign against html e-mail
/\  www.asciiribbon.org




_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to