【发布时间】:2015-05-12 17:05:41
【问题描述】:
假设我有一定年数的时间序列:
rng = pd.date_range(start = '2001-01-01',periods = 5113)
ts = pd.TimeSeries(np.random.randn(len(rng)), rng)
我可以通过以下方式计算它的标准年(所有年份中每一天的平均值):
std = ts.groupby([ts.index.month, ts.index.day]).mean()
现在我想知道如何从这个标准年份中减去我的多年时间序列,以便得到一个时间序列来显示哪些天低于或高于它的标准。
【问题讨论】:
标签: python datetime numpy pandas time-series