Skip to main content
`Ctrl`+`K`

# pandas.TimedeltaIndex.seconds

property TimedeltaIndex.seconds

  Number of seconds (>= 0 and less than 1 day) for each element.

  > This attribute returns the seconds component of each timedelta value, which is the number of seconds remaining after subtracting whole days. Values range from 0 to 86399.

  See also

  `Series.dt.seconds`

    Return number of seconds for each element.

  `Series.dt.nanoseconds`

    Return number of nanoseconds for each element.

  Examples

  For Series:

      >>> ser = pd.Series(pd.to_timedelta([1, 2, 3], unit='s'))
      >>> ser
      0   0 days 00:00:01
      1   0 days 00:00:02
      2   0 days 00:00:03
      dtype: timedelta64[s]
      >>> ser.dt.seconds
      0    1
      1    2
      2    3
      dtype: int32

  For TimedeltaIndex:

      >>> tdelta_idx = pd.to_timedelta([1, 2, 3], unit='s')
      >>> tdelta_idx
      TimedeltaIndex(['0 days 00:00:01', '0 days 00:00:02', '0 days 00:00:03'],
                     dtype='timedelta64[s]', freq=None)
      >>> tdelta_idx.seconds
      Index([1, 2, 3], dtype='int32')