Skip to content

Commit d130495

Browse files
committed
addressing review comments
1 parent db789c0 commit d130495

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

pandas/tests/resample/test_datetime_index.py

+8-9
Original file line numberDiff line numberDiff line change
@@ -644,13 +644,12 @@ def test_resample_dup_index():
644644
warning_msg = "DataFrame.resample with axis=1 is deprecated."
645645
with tm.assert_produces_warning(FutureWarning, match=warning_msg):
646646
result = df.resample("Q", axis=1).mean()
647-
msg = "DataFrame.groupby with axis=1 is deprecated"
648-
with tm.assert_produces_warning(FutureWarning, match=msg):
649-
expected = df.groupby(lambda x: int((x.month - 1) / 3), axis=1).mean()
650-
expected.columns = [
651-
Period(year=2000, quarter=i + 1, freq="Q") for i in range(4)
652-
]
653-
tm.assert_frame_equal(result, expected)
647+
648+
msg = "DataFrame.groupby with axis=1 is deprecated"
649+
with tm.assert_produces_warning(FutureWarning, match=msg):
650+
expected = df.groupby(lambda x: int((x.month - 1) / 3), axis=1).mean()
651+
expected.columns = [Period(year=2000, quarter=i + 1, freq="Q") for i in range(4)]
652+
tm.assert_frame_equal(result, expected)
654653

655654

656655
def test_resample_reresample(unit):
@@ -736,8 +735,8 @@ def test_resample_axis1(unit):
736735
warning_msg = "DataFrame.resample with axis=1 is deprecated."
737736
with tm.assert_produces_warning(FutureWarning, match=warning_msg):
738737
result = df.resample("M", axis=1).mean()
739-
expected = df.T.resample("M").mean().T
740-
tm.assert_frame_equal(result, expected)
738+
expected = df.T.resample("M").mean().T
739+
tm.assert_frame_equal(result, expected)
741740

742741

743742
@pytest.mark.parametrize("freq", ["t", "5t", "15t", "30t", "4h", "12h"])

0 commit comments

Comments
 (0)