From 6447f07c85c0afd161d29fa8fcf9bb7dc5d18a63 Mon Sep 17 00:00:00 2001 From: tuhinsharma121 Date: Fri, 17 May 2024 20:57:36 +0530 Subject: [PATCH 1/2] DOC: add SA01 ES01 for pandas.Timestamp.is_leap_year --- pandas/_libs/tslibs/timestamps.pyx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index fb22563d34e11..65d8a6730d438 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -820,9 +820,20 @@ cdef class _Timestamp(ABCTimestamp): """ Return True if year is a leap year. + A leap year is a year, which has 366 days (instead of 365) including 29th of + February as an intercalary day. Leap years are years which are multiples of + four with the exception of years divisible by 100 but not by 400. + Returns ------- bool + True if year is a leap year, else False + + See Also + -------- + Period.is_leap_year : Return True if the period’s year is in a leap year. + DatetimeIndex.is_leap_year : Boolean indicator if the date belongs to a + leap year. Examples -------- From 8424d77de913915dc8222c0e1ef5317eb2a0f199 Mon Sep 17 00:00:00 2001 From: tuhinsharma121 Date: Fri, 17 May 2024 20:57:53 +0530 Subject: [PATCH 2/2] DOC: remove SA01 ES01 for pandas.Timestamp.is_leap_year --- ci/code_checks.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 4bea3a462db07..b352e3c1d153f 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -260,7 +260,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Timestamp.fromordinal SA01" \ -i "pandas.Timestamp.fromtimestamp PR01,SA01" \ -i "pandas.Timestamp.hour GL08" \ - -i "pandas.Timestamp.is_leap_year SA01" \ -i "pandas.Timestamp.isocalendar SA01" \ -i "pandas.Timestamp.isoweekday SA01" \ -i "pandas.Timestamp.max PR02" \