From 9a9e3000407e10b4a5e87ec82e12022a971ea488 Mon Sep 17 00:00:00 2001 From: abonte <6319051+abonte@users.noreply.github.com> Date: Sat, 7 Jan 2023 13:03:12 +0100 Subject: [PATCH 1/2] DOC: update docstrings of Timestamp properties --- pandas/_libs/tslibs/timestamps.pyx | 46 +++++++++++++++++++++++++++--- 1 file changed, 42 insertions(+), 4 deletions(-) diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index b57f2ce5bd953..485d137eb5134 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -579,7 +579,16 @@ cdef class _Timestamp(ABCTimestamp): @property def is_month_start(self) -> bool: """ - Return True if date is first day of month. + Return True if the date is the first day of the month. + + Returns + ------- + bool + True if the date is the first day of the month. + + See Also + -------- + Timestamp.is_month_end : Similar property indicating the last day of the month. Examples -------- @@ -596,7 +605,16 @@ cdef class _Timestamp(ABCTimestamp): @property def is_month_end(self) -> bool: """ - Return True if date is last day of month. + Return True if the date is the last day of the month. + + Returns + ------- + bool + True if the date is the last day of the month. + + See Also + -------- + Timestamp.is_month_start : Similar property indicating month start. Examples -------- @@ -613,7 +631,17 @@ cdef class _Timestamp(ABCTimestamp): @property def is_quarter_start(self) -> bool: """ - Return True if date is first day of the quarter. + Return True if the date is the first day of the quarter. + + Returns + ------- + bool + True if date is first day of the quarter. + + See Also + -------- + Timestamp.is_quarter_end : Similar property indicating the quarter end. + Timestamp.quarter : Return the quarter of the date. Examples -------- @@ -630,7 +658,17 @@ cdef class _Timestamp(ABCTimestamp): @property def is_quarter_end(self) -> bool: """ - Return True if date is last day of the quarter. + Return True if the date is last day of the quarter. + + Returns + ------- + bool + True if date is last day of the quarter. + + See Also + -------- + Timestamp.is_quarter_start : Similar property indicating the quarter start. + Timestamp.quarter : Return the quarter of the date. Examples -------- From ec68587c78b61e4398e5ceedd4eeb03cd1226428 Mon Sep 17 00:00:00 2001 From: abonte <6319051+abonte@users.noreply.github.com> Date: Sat, 7 Jan 2023 19:25:45 +0100 Subject: [PATCH 2/2] fix first sentence in the docstrings --- pandas/_libs/tslibs/timestamps.pyx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index 485d137eb5134..0da8a9e73d963 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -579,7 +579,7 @@ cdef class _Timestamp(ABCTimestamp): @property def is_month_start(self) -> bool: """ - Return True if the date is the first day of the month. + Check if the date is the first day of the month. Returns ------- @@ -605,7 +605,7 @@ cdef class _Timestamp(ABCTimestamp): @property def is_month_end(self) -> bool: """ - Return True if the date is the last day of the month. + Check if the date is the last day of the month. Returns ------- @@ -631,7 +631,7 @@ cdef class _Timestamp(ABCTimestamp): @property def is_quarter_start(self) -> bool: """ - Return True if the date is the first day of the quarter. + Check if the date is the first day of the quarter. Returns ------- @@ -658,7 +658,7 @@ cdef class _Timestamp(ABCTimestamp): @property def is_quarter_end(self) -> bool: """ - Return True if the date is last day of the quarter. + Check if date is last day of the quarter. Returns -------