We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent a5c742a commit 9c42f82Copy full SHA for 9c42f82
pandas/_libs/tslibs/offsets.pyx
@@ -84,6 +84,8 @@ cdef to_offset(object obj):
84
Wrap pandas.tseries.frequencies.to_offset to keep centralize runtime
85
imports
86
"""
87
+ if isinstance(obj, _BaseOffset):
88
+ return obj
89
from pandas.tseries.frequencies import to_offset
90
return to_offset(obj)
91
pandas/_libs/tslibs/period.pyx
@@ -1567,7 +1567,6 @@ cdef class _Period(object):
1567
1568
@classmethod
1569
def _maybe_convert_freq(cls, object freq):
1570
-
1571
if isinstance(freq, (int, tuple)):
1572
code, stride = get_freq_code(freq)
1573
freq = get_freq_str(code, stride)
0 commit comments