Skip to content

Commit 2907b20

Browse files
authored
TST: add a test with freq=1MS to increase coverage of shift (pandas-dev#54211)
1 parent 2e881c3 commit 2907b20

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/tests/frame/methods/test_shift.py

+9
Original file line numberDiff line numberDiff line change
@@ -656,3 +656,12 @@ def test_shift_axis1_many_periods(self):
656656

657657
shifted2 = df.shift(-6, axis=1, fill_value=None)
658658
tm.assert_frame_equal(shifted2, expected)
659+
660+
def test_shift_with_offsets_freq(self):
661+
df = DataFrame({"x": [1, 2, 3]}, index=date_range("2000", periods=3))
662+
shifted = df.shift(freq="1MS")
663+
expected = DataFrame(
664+
{"x": [1, 2, 3]},
665+
index=date_range(start="02/01/2000", end="02/01/2000", periods=3),
666+
)
667+
tm.assert_frame_equal(shifted, expected)

0 commit comments

Comments
 (0)