Skip to content

Commit 36fa44c

Browse files
authored
to_offset was not using the compiled regex (#40138)
Resolves #39988.
1 parent 01770d1 commit 36fa44c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

pandas/_libs/tslibs/offsets.pyx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3579,7 +3579,7 @@ cpdef to_offset(freq):
35793579
stride_sign = None
35803580

35813581
try:
3582-
split = re.split(opattern, freq)
3582+
split = opattern.split(freq)
35833583
if split[-1] != "" and not split[-1].isspace():
35843584
# the last element must be blank
35853585
raise ValueError("last element must be blank")

0 commit comments

Comments
 (0)