We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9b22b12 commit 020f5a3Copy full SHA for 020f5a3
pandas/_libs/tslibs/fields.pyx
@@ -252,9 +252,10 @@ def get_start_end_field(
252
# QuarterBegin(), BQuarterBegin() use startingMonth = starting
253
# month of year. Other offsets use month, startingMonth as ending
254
# month of year.
255
-
256
- if (freqstr[0:2] in ["MS", "QS", "YS"]) or (
257
- 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()
+ ])
258
+ if (period_str in ["MS", "QS", "YS"]):
259
end_month = 12 if month_kw == 1 else month_kw - 1
260
start_month = month_kw
261
else:
0 commit comments