Hi,

I'm trying to read in single columns from an SQL database as 1D numpy
arrays with the correct types. So a FLOAT column would be returned as
a numpy.float32 array, etc. Is there an easy way to do this?

I tried to select a column from the whole table, and going through
each element and appending it to a list, then converting to a numpy
array, but the problem is that this doesn't guarantee the type of the
final numpy array. For example, if a column is:

[ Null, Null, 1.24124,5.12421, Null ]

converting this to a numpy array gives a numpy array of type
numpy.object type. Rather than trying to have an elaborate set of
rules to figure out how to convert each column to its correct type, I
thought there might be a robust way of doing this that just uses the
existing column definition to figure out which numpy type to use?

Thanks for any help,

Thomas

--~--~---------~--~----~------------~-------~--~----~
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