Skip to main content
`Ctrl`+`K`

# pandas.TimedeltaIndex.days

property TimedeltaIndex.days

  Number of days for each element.

  > This attribute returns the number of whole days in each timedelta value. It represents the days component of the duration, not the total duration expressed in days.

  See also

  `Series.dt.seconds`

    Return number of seconds for each element.

  `Series.dt.microseconds`

    Return number of microseconds 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='D'))
      >>> ser
      0   1 days
      1   2 days
      2   3 days
      dtype: timedelta64[s]
      >>> ser.dt.days
      0    1
      1    2
      2    3
      dtype: int64

  For TimedeltaIndex:

      >>> tdelta_idx = pd.to_timedelta(["0 days", "10 days", "20 days"])
      >>> tdelta_idx
      TimedeltaIndex(['0 days', '10 days', '20 days'],
                      dtype='timedelta64[us]', freq=None)
      >>> tdelta_idx.days
      Index([0, 10, 20], dtype='int64')