Skip to content
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions pandas/_libs/tslibs/offsets.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,22 @@ class ApplyTypeError(TypeError):
cdef class BaseOffset:
"""
Base class for DateOffset methods that are not overridden by subclasses.

Parameters:
-----------
n : int
Number of multiples of the frequency.

normalize : boolean
Whether the frequency can align with midnight.

Examples
--------
>>> pd.offsets.Hour(5).n
5

>>> pd.offsets.Hour(5).normalize
False
"""
# ensure that reversed-ops with numpy scalars return NotImplemented
__array_priority__ = 1000
Expand All @@ -384,23 +400,7 @@ cdef class BaseOffset:
def __init__(self, n=1, normalize=False):
n = self._validate_n(n)
self.n = n
"""
Number of multiples of the frequency.

Examples
--------
>>> pd.offsets.Hour(5).n
5
"""
self.normalize = normalize
"""
Return boolean whether the frequency can align with midnight.

Examples
--------
>>> pd.offsets.Hour(5).normalize
False
"""
self._cache = {}

def __eq__(self, other) -> bool:
Expand Down