开发者

Time series in Python up to microseconds

I would like to handle time series in Python.

It has been suggested to me that I 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 times, and I would like to avoid rewriting such features or any new classes from scratch when开发者_如何学运维ever it is possible.


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)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜