From 3550a2418b23eac869743c917bbcbf8c125d2433 Mon Sep 17 00:00:00 2001 From: tuhinsharma121 Date: Sun, 19 May 2024 11:34:25 +0530 Subject: [PATCH] DOC: add SA01 for pandas.Timestamp.weekday --- ci/code_checks.sh | 1 - pandas/_libs/tslibs/nattype.pyx | 6 ++++++ pandas/_libs/tslibs/timestamps.pyx | 6 ++++++ 3 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index a6447ffe86630..ccb368b400ac1 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -286,7 +286,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Timestamp.utcoffset SA01" \ -i "pandas.Timestamp.utctimetuple SA01" \ -i "pandas.Timestamp.value GL08" \ - -i "pandas.Timestamp.weekday SA01" \ -i "pandas.Timestamp.year GL08" \ -i "pandas.api.extensions.ExtensionArray._hash_pandas_object RT03,SA01" \ -i "pandas.api.extensions.ExtensionArray._pad_or_backfill PR01,RT03,SA01" \ diff --git a/pandas/_libs/tslibs/nattype.pyx b/pandas/_libs/tslibs/nattype.pyx index b23a5997b3245..c483814a3ef74 100644 --- a/pandas/_libs/tslibs/nattype.pyx +++ b/pandas/_libs/tslibs/nattype.pyx @@ -419,6 +419,12 @@ class NaTType(_NaT): Monday == 0 ... Sunday == 6. + See Also + -------- + Timestamp.dayofweek : Return the day of the week with Monday=0, Sunday=6. + Timestamp.isoweekday : Return the day of the week with Monday=1, Sunday=7. + datetime.date.weekday : Equivalent method in datetime module. + Examples -------- >>> ts = pd.Timestamp('2023-01-01') diff --git a/pandas/_libs/tslibs/timestamps.pyx b/pandas/_libs/tslibs/timestamps.pyx index 14b0836524888..04bd439b40b8d 100644 --- a/pandas/_libs/tslibs/timestamps.pyx +++ b/pandas/_libs/tslibs/timestamps.pyx @@ -2752,6 +2752,12 @@ default 'raise' Monday == 0 ... Sunday == 6. + See Also + -------- + Timestamp.dayofweek : Return the day of the week with Monday=0, Sunday=6. + Timestamp.isoweekday : Return the day of the week with Monday=1, Sunday=7. + datetime.date.weekday : Equivalent method in datetime module. + Examples -------- >>> ts = pd.Timestamp('2023-01-01')