Python中最长微秒的时间序列

2024-04-26 02:42:37 发布

您现在位置:Python中文网/ 问答频道 /正文

我想用Python处理时间序列。

有人建议我使用scikit.timeseries,但我需要处理高达微秒的时间,据我所知,最后一次处理高达毫秒。

你知道还有别的图书馆能做到吗?在某种程度上,我需要合并在不同时间采样的两个时间序列,并且我希望尽可能避免从头开始重写这些特性或任何新类。


Tags: 图书馆时间序列特性scikit建议timeseries新类
2条回答

阅读RedBlackPy。 您可以通过代码示例阅读article。 我认为RedBlackPy.Series是您想要的(它是为方便使用时间序列而构建的)。RedBlackPy现在可用于macosx和linux。

datetime模块处理微秒:

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

对使用timedelta对象的datetime执行算术运算将返回一个新的datetime对象:

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

datetime对象执行算术运算将返回timedelta对象。

>>> now - yest
datetime.timedelta(1)

相关问题 更多 >

    热门问题