合并 pandas 中的两个时间序列 [英] Merging two time series in pandas

查看:43
本文介绍了合并 pandas 中的两个时间序列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉,如果这确实记录在某处,但我很难找到它.我有两个带有一些重叠的日期/索引的TimeSeries,我想将它们合并.我假设必须指定两个系列中的哪个系列来获取重叠日期的值.为了说明,我有:

Apologies if this is obviously documented somewhere, but I'm having trouble discovering it. I have two TimeSeries with some overlapping dates/indices and I'd like to merge them. I assume I'll have to specify which of the two series to take the values from for the overlapping dates. For illustration I have:

s1:
2008-09-15    100
2008-10-15    101

s2:
2008-10-15    101.01
2008-11-15    102.02

我想要:

s3:
2008-09-15    100
2008-10-15    101
2008-11-15    102.02

s3:
2008-09-15    100
2008-10-15    101.01
2008-11-15    102.02

推荐答案

可以使用 查看全文

登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆