File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -476,12 +476,13 @@ def convert_timestamps(ndarray values):
476
476
477
477
return out
478
478
479
-
480
-
481
479
def maybe_indices_to_slice (ndarray[int64_t] indices ):
482
480
cdef:
483
481
Py_ssize_t i, n = len (indices)
484
482
483
+ if n == 0 :
484
+ return indices
485
+
485
486
for i in range (1 , n):
486
487
if indices[i] - indices[i - 1 ] != 1 :
487
488
return indices
Original file line number Diff line number Diff line change @@ -789,6 +789,12 @@ def test_at_time(self):
789
789
result = ts .at_time (time (0 , 0 ))
790
790
assert_series_equal (result , ts )
791
791
792
+ # time doesn't exist
793
+ rng = date_range ('1/1/2012' , freq = '23Min' , periods = 384 )
794
+ ts = Series (np .random .randn (len (rng )), rng )
795
+ rs = ts .at_time ('16:00' )
796
+ self .assert_ (len (rs ) == 0 )
797
+
792
798
def test_between_time (self ):
793
799
rng = date_range ('1/1/2000' , '1/5/2000' , freq = '5min' )
794
800
ts = Series (np .random .randn (len (rng )), index = rng )
You can’t perform that action at this time.
0 commit comments