@@ -203,18 +203,6 @@ def test_grouper_creation_bug(self):
203
203
expected = s .groupby (level = 'one' ).sum ()
204
204
assert_series_equal (result , expected )
205
205
206
- # GH25161
207
- s = Series (np .arange (10 ),
208
- index = pd .date_range (
209
- "2018-11-26 16:17:43.51" ,
210
- periods = 10 , freq = "1S" ))
211
- t0 = s .index [0 ]
212
- base = t0 .minute + (t0 .second + t0 .microsecond / 1e6 ) / 60
213
- g = s .groupby (pd .Grouper (freq = "10min" , base = base ))
214
- result = g .size ()
215
- expected = pd .Series (10 , index = Index ([t0 ]))
216
- assert_series_equal (result , expected )
217
-
218
206
def test_grouper_column_and_index (self ):
219
207
# GH 14327
220
208
@@ -315,6 +303,18 @@ def test_grouper_getting_correct_binner(self):
315
303
def test_grouper_iter (self , df ):
316
304
assert sorted (df .groupby ('A' ).grouper ) == ['bar' , 'foo' ]
317
305
306
+ def test_grouper_base (self ):
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 ))
314
+ result = g .size ()
315
+ expected = pd .Series (10 , index = Index ([t0 ]))
316
+ assert_series_equal (result , expected )
317
+
318
318
def test_empty_groups (self , df ):
319
319
# see gh-1048
320
320
with pytest .raises (ValueError , match = "No group keys passed!" ):
0 commit comments