Skip to content

Commit

Permalink
BUG: DatetimeIndex.is_year_start breaks on double-digit frequencies p…
Browse files Browse the repository at this point in the history
  • Loading branch information
VISWESWARAN1998 committed May 2, 2024
1 parent 9b22b12 commit 020f5a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pandas/_libs/tslibs/fields.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -252,9 +252,10 @@ def get_start_end_field(
# QuarterBegin(), BQuarterBegin() use startingMonth = starting
# month of year. Other offsets use month, startingMonth as ending
# month of year.

if (freqstr[0:2] in ["MS", "QS", "YS"]) or (
freqstr[1:3] in ["MS", "QS", "YS"]):
period_str = "".join([
dt_char for dt_char in list(freqstr.split("-")[0]) if not dt_char.isdigit()
])
if (period_str in ["MS", "QS", "YS"]):
end_month = 12 if month_kw == 1 else month_kw - 1
start_month = month_kw
else:
Expand Down

0 comments on commit 020f5a3

Please sign in to comment.