Skip to content

Commit 3b6d5f4

Browse files
committed
TST: Clarify resample float base test (pandas-dev#25161)
Use resample() which is what Grouper calls, assert index instead of result of size()
1 parent 11485fb commit 3b6d5f4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

pandas/tests/resample/test_datetime_index.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -757,11 +757,11 @@ def test_resample_float_base():
757757
"2018-11-26 16:17:44.51",
758758
"2018-11-26 16:17:45.51"])
759759
s = Series(np.arange(3), index=dt)
760+
760761
base = 17 + 43.51 / 60
761-
g = s.groupby(pd.Grouper(freq="3min", base=base))
762-
result = g.size()
763-
expected = Series(3, index=[dt[0]])
764-
assert_series_equal(result, expected)
762+
resampled = s.resample("3min", base=base).mean()
763+
exp_index = DatetimeIndex(["2018-11-26 16:17:43.51"])
764+
tm.assert_index_equal(resampled.index, exp_index)
765765

766766

767767
def test_resample_daily_anchored():

0 commit comments

Comments
 (0)