From 01b0899efa343835f979ee3b83f3e29237357408 Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Sat, 14 Sep 2024 19:48:49 +0530 Subject: [PATCH 1/2] DOC: fix SA01,ES01 for pandas.Timedelta.total_seconds --- ci/code_checks.sh | 1 - pandas/_libs/tslibs/timedeltas.pyx | 8 ++++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 7ad29b3a2a1f3..7f73bc81ce7be 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -107,7 +107,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -i "pandas.Timedelta.min PR02" \ -i "pandas.Timedelta.resolution PR02" \ -i "pandas.Timedelta.to_timedelta64 SA01" \ - -i "pandas.Timedelta.total_seconds SA01" \ -i "pandas.TimedeltaIndex.to_pytimedelta RT03,SA01" \ -i "pandas.Timestamp.max PR02" \ -i "pandas.Timestamp.min PR02" \ diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index 4f90f26cf31ab..00cecf5e7c5b0 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1189,6 +1189,14 @@ cdef class _Timedelta(timedelta): """ Total seconds in the duration. + This method calculates the total duration in seconds by combining + the days, seconds, and microseconds of the `Timedelta` object. + + See Also + -------- + to_timedelta : Convert argument to timedelta. + Timedelta : Represents a duration, the difference between two dates or times. + Examples -------- >>> td = pd.Timedelta('1min') From a8032a0ffd59550309eb492f69a4da3e622d12cc Mon Sep 17 00:00:00 2001 From: Tuhin Sharma Date: Sun, 15 Sep 2024 10:03:48 +0530 Subject: [PATCH 2/2] DOC: fix SA01,ES01 for pandas.Timedelta.total_seconds --- pandas/_libs/tslibs/nattype.pyx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pandas/_libs/tslibs/nattype.pyx b/pandas/_libs/tslibs/nattype.pyx index 60afc1acdc297..620e0846c750e 100644 --- a/pandas/_libs/tslibs/nattype.pyx +++ b/pandas/_libs/tslibs/nattype.pyx @@ -493,6 +493,14 @@ class NaTType(_NaT): """ Total seconds in the duration. + This method calculates the total duration in seconds by combining + the days, seconds, and microseconds of the `Timedelta` object. + + See Also + -------- + to_timedelta : Convert argument to timedelta. + Timedelta : Represents a duration, the difference between two dates or times. + Examples -------- >>> td = pd.Timedelta('1min')