Python 中的时间序列可达微秒

发布于 2024-08-31 15:21:27 字数 250 浏览 1 评论 0原文

我想用Python 处理时间序列。

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

您知道其他图书馆能够做到这一点吗?在某些时候,我需要合并在不同时间采样的两个时间序列,并且我希望尽可能避免从头开始重写此类功能或任何新类。

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 whenever it is possible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

ι不睡觉的鱼゛ 2024-09-07 15:21:27

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)

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)
永不分离 2024-09-07 15:21:27

了解 RedBlackPy
您可以阅读文章 带有代码示例。
我认为 RedBlackPy.Series 就是您想要的(它是为了方便处理时间序列而构建的)。 RedBlackPy 现在可用于 macOS 和 Linux。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文