Pandasを使用して、定義済みの日付の間に1時間ごとの間隔のセットを生成しようとしています。私が使用している:パンダで指定された時間間隔で1時間ごとのデータ範囲を生成
import pandas as pd
print pd.date_range(start='2013-04-01', end='2013-04-30', freq='1H')
DatetimeIndex(['2013-04-01 00:00:00', '2013-04-01 01:00:00',
'2013-04-01 02:00:00', '2013-04-01 03:00:00',
'2013-04-01 04:00:00', '2013-04-01 05:00:00',
'2013-04-01 06:00:00', '2013-04-01 07:00:00',
'2013-04-01 08:00:00', '2013-04-01 09:00:00',
...
'2013-04-29 15:00:00', '2013-04-29 16:00:00',
'2013-04-29 17:00:00', '2013-04-29 18:00:00',
'2013-04-29 19:00:00', '2013-04-29 20:00:00',
'2013-04-29 21:00:00', '2013-04-29 22:00:00',
'2013-04-29 23:00:00', '2013-04-30 00:00:00'],
dtype='datetime64[ns]', length=697, freq='H')
しかし、それはすなわち、[0-1]、[2-3]、[4-5]は、...しかし、私は何が必要、他の全ての時間間隔を生成し、 [0-1]、[1-2]、[2-3]のようなパーティションです...どうすればいいですか?前もって感謝します。
所望の出力:
DatetimeIndex(['2013-04-01 00:00:00', '2013-04-01 01:00:00',
'2013-04-01 01:00:00', '2013-04-01 02:00:00',
'2013-04-01 02:00:00', '2013-04-01 03:00:00',
'2013-04-01 03:00:00', '2013-04-01 04:00:00',
'2013-04-01 04:00:00', '2013-04-01 05:00:00',
...
'2013-04-29 19:00:00', '2013-04-29 20:00:00',
'2013-04-29 20:00:00', '2013-04-29 21:00:00',
'2013-04-29 21:00:00', '2013-04-29 22:00:00',
'2013-04-29 22:00:00', '2013-04-29 23:00:00',
'2013-04-29 23:00:00', '2013-04-30 00:00:00'],
dtype='datetime64[ns]', length=697, freq='H')
ありがとう@John Galt – Paul