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.

2 Answers

4
jathanism On Best Solutions

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)
0
Кирилл Солодских On

Read about RedBlackPy. You can read article with code examples. I think that RedBlackPy.Series is what you want (it is built for convenient work with time series). RedBlackPy is available for macosx and linux now.