time series data and NumPy

Robert Kern robert.kern at gmail.com
Fri Jan 26 13:46:40 EST 2007


Diez B. Roggisch wrote:

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

Yes, one can make numpy arrays with "object" as its type. One can even extend
the C-level parts as well. For example, we have an experimental package in the
scipy sandbox for uniform time series that uses mx.DateTime.

  http://www.scipy.org/TimeSeriesPackage

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

This is frequently what I do. For dates, I like Modified Julian Day Numbers
although I am sure that would horrify some people more knowledgeable than I.

-- 
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco




More information about the Python-list mailing list