BBands wrote: > Good morning, > > I store time series data in a SQL database. The results of a typical > query using pyodbc look like this. > > Date Close > "2007-01-17" 22.57 > > Where Date is a datetime.date object and Close is a float. > > I'd like to put this data in a NumPy array for processing, but am > unsure as to how to handle the date. In the past I've used lists, but I > am looking to boost speed a bit as I wish to do a large number of > transformations and comparisons. > > Can one index an array using datetime objects? > > For example it would be nice to do a union of two arrays so that any > dates missing in either one were eliminated. > > Thoughts on doing rolling operations, such as an n-period average or > variance? > > Thoughts on working with time series data in arrays in general?
I'm pretty sure you're out of luck here - even _if_ NumPy would handle arbitrary data-types (AFAIK it doesn't, but then I'm not a total expert there), it certainly won't be able to make its hi-performance functions work on them. What you could do would be to convert the date-column into a timestamp, which is a int/long, and use that. Would that help? diez -- http://mail.python.org/mailman/listinfo/python-list