Skip to content

Commit 39e0505

Browse files
Backport PR #52354 on branch 2.0.x (Fixed up formatting of docstring of DateOffset) (#52361)
Backport PR #52354: Fixed up formatting of docstring of DateOffset Co-authored-by: Nishu Choudhary <[email protected]>
1 parent c922324 commit 39e0505

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

pandas/_libs/tslibs/offsets.pyx

+8-8
Original file line numberDiff line numberDiff line change
@@ -1347,18 +1347,18 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta):
13471347
valid dates. For example, Bday(2) can be added to a date to move
13481348
it two business days forward. If the date does not start on a
13491349
valid date, first it is moved to a valid date. Thus pseudo code
1350-
is:
1350+
is::
13511351
1352-
def __add__(date):
1353-
date = rollback(date) # does nothing if date is valid
1354-
return date + <n number of periods>
1352+
def __add__(date):
1353+
date = rollback(date) # does nothing if date is valid
1354+
return date + <n number of periods>
13551355
13561356
When a date offset is created for a negative number of periods,
1357-
the date is first rolled forward. The pseudo code is:
1357+
the date is first rolled forward. The pseudo code is::
13581358
1359-
def __add__(date):
1360-
date = rollforward(date) # does nothing is date is valid
1361-
return date + <n number of periods>
1359+
def __add__(date):
1360+
date = rollforward(date) # does nothing if date is valid
1361+
return date + <n number of periods>
13621362
13631363
Zero presents a problem. Should it roll forward or back? We
13641364
arbitrarily have it rollforward:

0 commit comments

Comments
 (0)