pandas.Timedelta.seconds — pandas 3.0.0.dev0+2106.gb2b2d04e41 documentation (original) (raw)
Timedelta.seconds#
Return the total hours, minutes, and seconds of the timedelta as seconds.
Timedelta.seconds = hours * 3600 + minutes * 60 + seconds.
Returns:
int
Number of seconds.
See also
Return all attributes with assigned values (i.e. days, hours, minutes, seconds, milliseconds, microseconds, nanoseconds).
Express the Timedelta as total number of seconds.
Examples
Using string input
td = pd.Timedelta('1 days 2 min 3 us 42 ns') td.seconds 120
Using integer input
td = pd.Timedelta(42, unit='s') td.seconds 42