Skip to content

Commit 1c2175d

Browse files
committed
TST: Clarify the test using literal values (pandas-dev#26240)
1 parent f993901 commit 1c2175d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

pandas/tests/groupby/test_grouping.py

+7-7
Original file line numberDiff line numberDiff line change
@@ -305,14 +305,14 @@ def test_grouper_iter(self, df):
305305

306306
def test_grouper_base(self):
307307
# 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))
314314
result = g.size()
315-
expected = pd.Series(10, index=Index([t0]))
315+
expected = Series(3, index=[dt[0]])
316316
assert_series_equal(result, expected)
317317

318318
def test_empty_groups(self, df):

0 commit comments

Comments
 (0)