views:

179

answers:

1

Hi All

I would like to handle time series in python. I have been suggested to use scikit.timeseries but I need to handle up to microseconds and this last, as far as I know, handles up to milliseconds.

Do you know any other library able to do that? At some point I need to merge 2 time series sampled at different time, and I would like to avoid rewriting such kind of features or any new classes from scratch whenever it is possible.

I thank you all AFG

+2  A: 

The datetime module handles microseconds:

>>> import datetime
>>> now = datetime.datetime.now()
>>> now.microsecond 
38672

Performing arithmetic operations against a datetime using a timedelta object returns a new datetime object:

>>> yest = now - datetime.timedelta(days=1)
>>> yest
datetime.datetime(2010, 5, 9, 12, 37, 19, 38672)
>>> now
datetime.datetime(2010, 5, 10, 12, 37, 19, 38672)

Performing arithmetic operations against datetime objects returns a timedelta object.

>>> now - yest
datetime.timedelta(1)
jathanism
Hi jathanism. Thanks for the response. I was more interested in some existing timeseries class. Do you know any?
Abruzzo Forte e Gentile
Well, from what I know of a timeseries it is just iterating through a range of dates/times, correct? It would be trivial to do something like: `for i in range(1,7): print now + datetime.timedelta(days=i)`. Perhaps I am misunderstanding your issue.
jathanism