Skip to content

DOC: fix SA01 for pandas.Timedelta.days #59068

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ci/code_checks.sh
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,6 @@ if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
-i "pandas.Timedelta.asm8 SA01" \
-i "pandas.Timedelta.ceil SA01" \
-i "pandas.Timedelta.components SA01" \
-i "pandas.Timedelta.days SA01" \
-i "pandas.Timedelta.floor SA01" \
-i "pandas.Timedelta.max PR02" \
-i "pandas.Timedelta.min PR02" \
Expand Down
12 changes: 12 additions & 0 deletions pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1078,10 +1078,22 @@ cdef class _Timedelta(timedelta):
"""
Returns the days of the timedelta.

The `days` attribute of a `pandas.Timedelta` object provides the number
of days represented by the `Timedelta`. This is useful for extracting
the day component from a `Timedelta` that may also include hours, minutes,
seconds, and smaller time units. This attribute simplifies the process
of working with durations where only the day component is of interest.

Returns
-------
int

See Also
--------
Timedelta.seconds : Returns the seconds component of the timedelta.
Timedelta.microseconds : Returns the microseconds component of the timedelta.
Timedelta.total_seconds : Returns the total duration in seconds.

Examples
--------
>>> td = pd.Timedelta(1, "d")
Expand Down
Loading