diff --git a/ci/code_checks.sh b/ci/code_checks.sh index f9860de3b2bb3..7e4b5775af317 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -89,8 +89,8 @@ fi ### DOCSTRINGS ### if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then - MSG='Validate docstrings (GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA02,SA03 + MSG='Validate docstrings (GL02, GL03, GL04, GL05, GL06, GL07, GL09, GL10, SS01, SS02, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT01, RT04, RT05, SA02, SA03)' ; echo $MSG + $BASE_DIR/scripts/validate_docstrings.py --format=actions --errors=GL02,GL03,GL04,GL05,GL06,GL07,GL09,GL10,SS02,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT01,RT04,RT05,SA02,SA03 RET=$(($RET + $?)) ; echo $MSG "DONE" fi diff --git a/pandas/_libs/tslibs/nattype.pyx b/pandas/_libs/tslibs/nattype.pyx index bac82b158589d..268cdb80c22f3 100644 --- a/pandas/_libs/tslibs/nattype.pyx +++ b/pandas/_libs/tslibs/nattype.pyx @@ -409,8 +409,20 @@ class NaTType(_NaT): # These are the ones that can get their docstrings from datetime. # nan methods - weekday = _make_nan_func("weekday", datetime.weekday.__doc__) - isoweekday = _make_nan_func("isoweekday", datetime.isoweekday.__doc__) + weekday = _make_nan_func( + "weekday", + """ + Return the day of the week represented by the date. + Monday == 0 ... Sunday == 6. + """, + ) + isoweekday = _make_nan_func( + "isoweekday", + """ + Return the day of the week represented by the date. + Monday == 1 ... Sunday == 7. + """, + ) total_seconds = _make_nan_func("total_seconds", timedelta.total_seconds.__doc__) month_name = _make_nan_func( "month_name", diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index 7ed0f110f36db..5a3a95384e731 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -1960,6 +1960,20 @@ default 'raise' self.nanosecond / 3600.0 / 1e+9 ) / 24.0) + def isoweekday(self): + """ + Return the day of the week represented by the date. + Monday == 1 ... Sunday == 7. + """ + return super().isoweekday() + + def weekday(self): + """ + Return the day of the week represented by the date. + Monday == 0 ... Sunday == 6. + """ + return super().weekday() + # Aliases Timestamp.weekofyear = Timestamp.week