Skip to content

Commit a6a01cb

Browse files
committed
New modifications for PR
1 parent 7fbfb65 commit a6a01cb

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

pandas/tests/groupby/test_grouping.py

-11
Original file line numberDiff line numberDiff line change
@@ -149,17 +149,6 @@ def test_grouper_index_types(self):
149149
df.index = list(reversed(df.index.tolist()))
150150
df.groupby(list("abcde")).apply(lambda x: x)
151151

152-
def test_grouper_period_index(self):
153-
# GH 32108
154-
periods = 2
155-
index = pd.period_range(start="2018-01", periods=periods, freq="M")
156-
period_serie = pd.Series(range(periods), index=index)
157-
period_serie.index.name = "Month"
158-
result = period_serie.groupby(period_serie.index.month).sum()
159-
160-
expected = pd.Series(range(0, periods), index=range(1, periods + 1))
161-
expected.index.name = period_serie.index.name
162-
tm.assert_series_equal(result, expected)
163152

164153
def test_grouper_multilevel_freq(self):
165154

pandas/tests/groupby/test_timegrouper.py

+16
Original file line numberDiff line numberDiff line change
@@ -769,3 +769,19 @@ def test_scalar_call_versus_list_call(self):
769769
expected = grouped.count()
770770

771771
tm.assert_frame_equal(result, expected)
772+
773+
774+
def test_grouper_period_index(self):
775+
# GH 32108
776+
periods = 2
777+
index = pd.period_range(start="2018-01", periods=periods, freq="M",
778+
name="Month")
779+
period_serie = pd.Series(range(periods), index=index)
780+
result = period_serie.groupby(period_serie.index.month).sum()
781+
782+
expected = pd.Series(range(0, periods),
783+
index=Index(range(1, periods + 1),
784+
name=period_serie.index.name)
785+
tm.assert_series_equal(result, expected)
786+
787+

0 commit comments

Comments
 (0)