[Numpy-discussion] How to convert a list into a structured array?

Francesc Alted faltet at pytables.org
Tue May 5 03:10:25 EDT 2009


Welcome Wei!

A Monday 04 May 2009, Wei Su escrigué:
> Hi,All:
>  
> My first post! I am very excited to find out structured array (record
> array) in Python. Since I do data manipulation every day, this is
> truly great. However, I typically download data using pyodbc, the
> default output is a big list. So I am wondering how to convert that
> big list into a structured array? using array() will turn it into a
> text array, afaik. it is even better if anybody can show me some
> tricks to download the data directly as a structured array. 
> Thanks a lot for the help.

Please, could you provide an example of the list that you are getting 
from your database?  With that we can probably figure out your needs 
much better.

> BTW: I am also interested in Python's ability to handle large data.
> Any hints or suggestion is welcome.

This is also a bit generic question.  What kind of data you have to deal 
with?  What sort of operations do you want to perform over it?  Do you 
need a lot of speed or flexibility is more important?  Some example?

Cheers,

-- 
Francesc Alted

"One would expect people to feel threatened by the 'giant
brains or machines that think'.  In fact, the frightening
computer becomes less frightening if it is used only to
simulate a familiar noncomputer."

-- Edsger W. Dykstra
   "On the cruelty of really teaching computer science"



More information about the NumPy-Discussion mailing list