Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
VISWESWARAN1998 committed May 2, 2024
1 parent 020f5a3 commit 8df36f7
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions pandas/_libs/tslibs/fields.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -246,15 +246,14 @@ def get_start_end_field(
if freqstr:
if freqstr == "C":
raise ValueError(f"Custom business days is not supported by {field}")
is_business = freqstr[0] == "B"

period_str = "".join([
dt_char for dt_char in list(freqstr.split("-")[0]) if not dt_char.isdigit()
])
is_business = period_str == "B"
# YearBegin(), BYearBegin() use month = starting month of year.
# QuarterBegin(), BQuarterBegin() use startingMonth = starting
# month of year. Other offsets use month, startingMonth as ending
# month of year.
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
Expand Down

0 comments on commit 8df36f7

Please sign in to comment.