Hi,
I think it would be cool to have an option to obtain the results of a
sqlalchemy query as a numpy's recarray, instead of a list of tuples as
it is now.

Examples:

>>> data = session.query(People.name, People.surname, People.apples, 
>>> People.pears).as_recarray()
>>> data['name']
Albert
Mario
Luigi
Giuseppe

>>> print data['name'], data['apples']
Albert 10
Mario 20
Luigi 13
Giuseppe 15

>>> pylab.plot(data['name'], data['apples']

I don't know if it is already possible to obtain something like this,
but I couldn't find anything related with google.
It would greatly simplify plotting and statistics calculations with
sqlalchemy, and it won't be too difficult to implement (however I
admit that I don't know much of sqlalchemy's code)
The R's RMySQL library (R is a programming language for data analysis
and plotting - http://www.r-project.org/) already works like this, and
it is very useful; however it is not an ORM library and not python.

You can find some documentations on numpy's recarray here:
- 
http://www.scipy.org/Numpy_Example_List#head-bf12166d60e12d84eebf19e80b5233e346e9d7f4
- http://www.scipy.org/Tentative_NumPy_Tutorial

but it seems that better documentation will be published soon.



-- 
Giovanni Dall'Olio, phd student
Department of Biologia Evolutiva at CEXS-UPF (Barcelona, Spain)

My blog on bioinformatics: http://bioinfoblog.it

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to