Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions pandas/_libs/tslibs/offsets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -3705,7 +3705,7 @@ cdef inline void _shift_months(const int64_t[:] dtindex,
"""See shift_months.__doc__"""
cdef:
Py_ssize_t i
int months_to_roll, compare_day
int months_to_roll
npy_datetimestruct dts

for i in range(count):
Expand All @@ -3715,10 +3715,8 @@ cdef inline void _shift_months(const int64_t[:] dtindex,

dt64_to_dtstruct(dtindex[i], &dts)
months_to_roll = months
compare_day = get_day_of_month(&dts, day_opt)

months_to_roll = roll_convention(dts.day, months_to_roll,
compare_day)
months_to_roll = _roll_qtrday(&dts, months_to_roll, 0, day_opt)

dts.year = year_add_months(dts, months_to_roll)
dts.month = month_add_months(dts, months_to_roll)
Expand Down