Skip to content

Commit 4379fe3

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

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

pandas/tests/groupby/test_grouping.py

-12
Original file line numberDiff line numberDiff line change
@@ -149,18 +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)
163-
164152
def test_grouper_multilevel_freq(self):
165153

166154
# GH 7885

pandas/tests/groupby/test_timegrouper.py

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

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

0 commit comments

Comments
 (0)