在 Python 中绘制不规则采样数据点

发布于 2025-01-14 22:35:42 字数 548 浏览 2 评论 0原文

我有数据样本,有一个大小,以及相关的时间和时间。取样日期。

我想随时间绘制这些数据点,但希望数据点间隔与采样时间成比例。

本质上,我有一个人每天在不一致的时间段内进行不同数量的读数。

关于如何创建这个时间情节有什么想法吗?

Example Data:

Mag    : Time     , Date
4.0 in : 11:12:02 , 11/11/21
4.3 in : 13:27:01 , 11/11/21
7.5 in : 14:01:45 , 11/11/21
2.1 in : 01:27:54 , 11/13/21
1.4 in : 16:32:41,  11/13/21
0.7 in : 14:12:09,  11/14/21
0.8 in : 14:12:13,  11/14/21

我想采样并保持(直到下一个数据点),或者(最好)如果可能的话,用线性线连接迹线的每个点,并应用平滑函数,这样线图中就没有突然的特征。

一旦我绘制了这个图,我还想可能重新采样和/或积分曲线下的面积......但这可能是另一天的任务。

谢谢!

I have data samples, that have a magnitude, with an associated time & date of when the sample was taken.

I would like to plot these datapoints over time, but would like the datapoints spaced, proportionally to the time they were sampled.

Essentially I have a person that is taking various numbers of readings per day, at inconsistent time periods.

Any ideas on how to create this time plot?

Example Data:

Mag    : Time     , Date
4.0 in : 11:12:02 , 11/11/21
4.3 in : 13:27:01 , 11/11/21
7.5 in : 14:01:45 , 11/11/21
2.1 in : 01:27:54 , 11/13/21
1.4 in : 16:32:41,  11/13/21
0.7 in : 14:12:09,  11/14/21
0.8 in : 14:12:13,  11/14/21

I would like to either sample and hold (til next datapoint), or (preferably) if possible, connect each point of the trace with a linear line, and apply a smoothing function, so there are no abrupt features in the line plot.

Once I get this plotted, I would also like to possibly resample and/or integrate the area under the curve... but that can be a task for another day.

Thanks!

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文