Skip to content

DOC: Updating the timedeltas.seconds docstring for Issue #50969 #51522

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 7 commits into from
Feb 21, 2023
6 changes: 6 additions & 0 deletions pandas/_libs/tslibs/timedeltas.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -1065,6 +1065,11 @@ cdef class _Timedelta(timedelta):

Timedelta.seconds = hours * 3600 + minutes * 60 + seconds.

Whenever a negative timedelta is calculate, the `seconds` method is represented
as the difference of 86400 seconds (24 hours) minus the absolute value
of the calculated timedelta. To retrieve the expected output, the
`total_seconds()` method should be called instead
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this, the 'see also' should be sufficient

Copy link
Contributor Author

@rmhowe425 rmhowe425 Feb 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay! Removing lines 1068 - 1071 and pushing again

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MarcoGorelli I just updated the docstring and removed lines 1068-1071


Returns
-------
int
Expand All @@ -1075,6 +1080,7 @@ cdef class _Timedelta(timedelta):
Timedelta.components : Return all attributes with assigned values
(i.e. days, hours, minutes, seconds, milliseconds, microseconds,
nanoseconds).
Timedelta.total_seconds : Express the TimeDelta as total number of seconds.

Examples
--------
Expand Down