From d1addffa9823569eeb11869cc5c69c486c460e17 Mon Sep 17 00:00:00 2001 From: Nishu Choudhary Date: Sat, 1 Apr 2023 23:06:57 -0400 Subject: [PATCH] Fixed up formatting of docstring of DateOffset --- pandas/_libs/tslibs/offsets.pyx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/pandas/_libs/tslibs/offsets.pyx b/pandas/_libs/tslibs/offsets.pyx index 9718641e75f60..8ec75cfa11052 100644 --- a/pandas/_libs/tslibs/offsets.pyx +++ b/pandas/_libs/tslibs/offsets.pyx @@ -1350,18 +1350,18 @@ class DateOffset(RelativeDeltaOffset, metaclass=OffsetMeta): valid dates. For example, Bday(2) can be added to a date to move it two business days forward. If the date does not start on a valid date, first it is moved to a valid date. Thus pseudo code - is: + is:: - def __add__(date): - date = rollback(date) # does nothing if date is valid - return date + + def __add__(date): + date = rollback(date) # does nothing if date is valid + return date + When a date offset is created for a negative number of periods, - the date is first rolled forward. The pseudo code is: + the date is first rolled forward. The pseudo code is:: - def __add__(date): - date = rollforward(date) # does nothing is date is valid - return date + + def __add__(date): + date = rollforward(date) # does nothing if date is valid + return date + Zero presents a problem. Should it roll forward or back? We arbitrarily have it rollforward: