DatetimeIndex を作成し、そのインデックスでデータをリサンプリングしたいと考えています。私がそれをすると、例外が発生します:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/pandas-0.8.1-py2.7-linux-i686.egg/pandas/core/generic.py", line 188, in resample
limit=limit, base=base)
File "/usr/local/lib/python2.7/dist-packages/pandas-0.8.1-py2.7-linux-i686.egg/pandas/tseries/resample.py", line 41, in __init__
self.freq = to_offset(freq)
File "/usr/local/lib/python2.7/dist-packages/pandas-0.8.1-py2.7-linux-i686.egg/pandas/tseries/frequencies.py", line 392, in to_offset
raise ValueError("Could not evaluate %s" % freqstr)
ValueError: Could not evaluate <class 'pandas.tseries.index.DatetimeIndex'>
[2012-03-02 09:00:00, ..., 2012-03-02 15:00:00]
Length: 73, Freq: 5T, Timezone: None
TimeGrouper.resample は DatetimeIndex を処理することになっているようですが、TimeGrouper init の to_offset への呼び出しは処理しません。しかし、ここで何かが欠けている可能性があります。
インデックスでリサンプリングする方法はありますか? またはおそらく回避策-私がやろうとしているのは、特定の頻度(たとえば、1Min)でサンプリングすることだけですが、元の時系列に必ずしもデータポイントがあるとは限らない開始/終了時間で(私はたくさんの時系列は午前 8 時から午後 4 時までサンプリングされていますが、午前 9 時 30 分からの値しかないものや、午前 10 時からの値しかないものもあります。)