2013-10-09 53 views

回答

1

如果您希望此間隔在結束點處關閉/打開,您可以指定一些選項。

In [7]: rng 
Out[7]: 
<class 'pandas.tseries.index.DatetimeIndex'> 
[2012-01-01 00:00:00, ..., 2013-01-01 00:00:00] 
Length: 527041, Freq: T, Timezone: None 

In [8]: rng[rng.indexer_between_time('9:30','16:00')] 
Out[8]: 
<class 'pandas.tseries.index.DatetimeIndex'> 
[2012-01-01 09:30:00, ..., 2012-12-31 16:00:00] 
Length: 143106, Freq: None, Timezone: None 
相關問題