We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 772c540 commit 3fee117Copy full SHA for 3fee117
pandas/_libs/tslibs/period.pyx
@@ -1529,7 +1529,16 @@ cdef class _Period:
1529
self._dtype = PeriodPseudoDtype(freq._period_dtype_code)
1530
1531
@classmethod
1532
- def _maybe_convert_freq(cls, object freq):
+ def _maybe_convert_freq(cls, object freq) -> BaseOffset:
1533
+ """
1534
+ Internally we allow integer and tuple representations (for now) that
1535
+ are not recognized by to_offset, so we convert them here. Also, a
1536
+ Period's freq attribute must have `freq.n > 0`, which we check for here.
1537
+
1538
+ Returns
1539
+ -------
1540
+ DateOffset
1541
1542
if isinstance(freq, (int, tuple)):
1543
code, stride = get_freq_code(freq)
1544
freq = get_freq_str(code, stride)
0 commit comments