File tree 1 file changed +7
-7
lines changed
1 file changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -305,14 +305,14 @@ def test_grouper_iter(self, df):
305
305
306
306
def test_grouper_base (self ):
307
307
# GH25161
308
- s = Series ( np . arange ( 10 ) ,
309
- index = pd . date_range (
310
- "2018-11-26 16:17:43 .51" ,
311
- periods = 10 , freq = "1S" ) )
312
- base = t0 . minute + ( t0 . second + t0 . microsecond / 1e6 ) / 60
313
- g = s .groupby (pd .Grouper (freq = "10min " , base = base ))
308
+ dt = pd . to_datetime ([ "2018-11-26 16:17:43.51" ,
309
+ "2018-11-26 16:17:44.51" ,
310
+ "2018-11-26 16:17:45 .51" ])
311
+ s = Series ( np . arange ( 3 ), index = dt )
312
+ base = 17 + 43.51 / 60
313
+ g = s .groupby (pd .Grouper (freq = "3min " , base = base ))
314
314
result = g .size ()
315
- expected = pd . Series (10 , index = Index ([ t0 ]) )
315
+ expected = Series (3 , index = [ dt [ 0 ]] )
316
316
assert_series_equal (result , expected )
317
317
318
318
def test_empty_groups (self , df ):
You can’t perform that action at this time.
0 commit comments